 url = require 'url'
 fs = require 'fs-plus'
+{CompositeDisposable} = require 'atom'
 
 MarkdownPreviewView = null
 renderer = null

      else
        atom.clipboard.write(html)

  saveAsHtml: ->
    activePane = atom.workspace.getActivePaneItem()
    if isMarkdownPreviewView(activePane)
      activePane.saveAs()


module.exports =
  activate: ->
    @disposables = new CompositeDisposable()
    @disposables.add atom.commands.add 'atom-workspace',
      'markdown-preview:toggle': =>
        @toggle()
      'markdown-preview:copy-html': =>
        @copyHTML()
      'markdown-preview:save-as-html': =>
        @saveAsHTML()
      'markdown-preview:toggle-break-on-single-newline': ->
        keyPath = 'markdown-preview.breakOnSingleNewline'
        atom.config.set(keyPath, not atom.config.get(keyPath))
