mirror of
https://github.com/atom/atom.git
synced 2026-02-03 19:25:06 -05:00
Remove *.getLastCursor()
This commit is contained in:
@@ -57,7 +57,7 @@ class Cursor
|
||||
isVisible: -> @visible
|
||||
|
||||
isLastCursor: ->
|
||||
this == @editSession.getLastCursor()
|
||||
this == @editSession.getCursor()
|
||||
|
||||
autoscrolled: ->
|
||||
@needsAutoscroll = false
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user