     ).bind(this)
     return
 
-  doCaseSplit: ->
-    editor = atom.workspace.getActiveEditor()
-    line = editor.getCursor(0).getBufferRow()
+  doCaseSplit: =>
+    editor = atom.workspace.getActiveEditor()
+    line = editor.getLastCursor().getBufferRow()
     word = @getWordUnderCursor()
     @model.caseSplit line + 1, word, ((err, split) ->
       if err

        console.log '... ' + progress
        @statusbar.setStatus 'Idris: ' + progress
      else
        @statusbar.setStatus 'Idris: ' + message
      return
    ).bind(this)
    return

    'language-idris:proof-search': @doProofSearch

  isIdrisFile: (uri) ->
    if uri? && uri.match?
      uri.match /\.idr$/
    else
      false

  idrisFileOpened: (editor) ->
    @idrisBuffers += 1
