Remove *.getLastCursor()

This commit is contained in:
Corey Johnson
2013-01-08 18:26:37 -08:00
parent f9e9b4203c
commit 95dcf275e4
5 changed files with 12 additions and 16 deletions

View File

@@ -57,7 +57,7 @@ class Cursor
isVisible: -> @visible
isLastCursor: ->
this == @editSession.getLastCursor()
this == @editSession.getCursor()
autoscrolled: ->
@needsAutoscroll = false

View File

@@ -370,9 +370,6 @@ class EditSession
getCursor: ->
_.last(@cursors)
getLastCursor: ->
_.last(@cursors)
addCursorAtScreenPosition: (screenPosition) ->
@addCursor(new Cursor(editSession: this, screenPosition: screenPosition))
@@ -455,16 +452,16 @@ class EditSession
@moveCursors (cursor) -> cursor.setScreenPosition(position)
getCursorScreenPosition: ->
@getLastCursor().getScreenPosition()
@getCursor().getScreenPosition()
getCursorScreenRow: ->
@getLastCursor().getScreenRow()
@getCursor().getScreenRow()
setCursorBufferPosition: (position, options) ->
@moveCursors (cursor) -> cursor.setBufferPosition(position, options)
getCursorBufferPosition: ->
@getLastCursor().getBufferPosition()
@getCursor().getBufferPosition()
getSelectedScreenRange: ->
@getLastSelection().getScreenRange()

View File

@@ -187,7 +187,6 @@ class Editor extends View
getCursor: -> @activeEditSession.getCursor()
getCursors: -> @activeEditSession.getCursors()
getLastCursor: -> @activeEditSession.getLastCursor()
addCursorAtScreenPosition: (screenPosition) -> @activeEditSession.addCursorAtScreenPosition(screenPosition)
addCursorAtBufferPosition: (bufferPosition) -> @activeEditSession.addCursorAtBufferPosition(bufferPosition)
moveCursorUp: -> @activeEditSession.moveCursorUp()

View File

@@ -26,7 +26,7 @@ module.exports =
enableSnippetsInEditor: (editor) ->
editor.command 'snippets:expand', (e) =>
editSession = editor.activeEditSession
prefix = editSession.getLastCursor().getCurrentWordPrefix()
prefix = editSession.getCursor().getCurrentWordPrefix()
if snippet = @snippetsByExtension[editSession.getFileExtension()]?[prefix]
editSession.transact ->
snippetExpansion = new SnippetExpansion(snippet, editSession)