     # gitPlusViewState: @gitPlusView.serialize()
 
   gitStatus: ->
+    @currentPane = atom.workspace.getActivePane()
     process = new BufferedProcess({
       command: 'git'
       args: ['status']

    text = text.replace(/\n/g, "\n# ")
    # in order to make sure each line doesn't start with a space, the preceding
    #   line should end with a backslash
    new File(@commitFilePath)
      .write " \n\
       # Please enter the commit message for your changes. Lines starting\n\
       # with '#' will be ignored, and an empty message aborts the commit.\n\

    @showFile()

  showFile: ->
    atom.workspace.open @commitFilePath(), split: 'right', activatePane: true
    PathWatcher.watch @commitFilePath(), (event) =>
      if event is 'change'
        @commit()

  commit: ->
    process = new BufferedProcess({
      command: 'git'
      args: ['commit', "--file=#{@commitFilePath()}"]
      options:
        cwd: @dir
      stdout: (data) =>
        PathWatcher.closeAllWatchers()
        atom.workspace.destroyActivePane()
        @currentPane.activate()
      stderror: (data) =>
        alert data.toString()
    })
