mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Move adding cursor functions under more heavily used functions
This commit is contained in:
@@ -1514,20 +1514,6 @@ class Editor extends Model
|
||||
hasMultipleCursors: ->
|
||||
@getCursors().length > 1
|
||||
|
||||
# Essential: Add a cursor at the given position in buffer coordinates.
|
||||
#
|
||||
# Returns a {Cursor}.
|
||||
addCursorAtBufferPosition: (bufferPosition) ->
|
||||
@markBufferPosition(bufferPosition, @getSelectionMarkerAttributes())
|
||||
@getLastSelection().cursor
|
||||
|
||||
# Essential: Add a cursor at the position in screen coordinates.
|
||||
#
|
||||
# Returns a {Cursor}.
|
||||
addCursorAtScreenPosition: (screenPosition) ->
|
||||
@markScreenPosition(screenPosition, @getSelectionMarkerAttributes())
|
||||
@getLastSelection().cursor
|
||||
|
||||
# Essential: Get the position of the most recently added cursor in buffer
|
||||
# coordinates.
|
||||
#
|
||||
@@ -1571,6 +1557,20 @@ class Editor extends Model
|
||||
setCursorScreenPosition: (position, options) ->
|
||||
@moveCursors (cursor) -> cursor.setScreenPosition(position, options)
|
||||
|
||||
# Essential: Add a cursor at the given position in buffer coordinates.
|
||||
#
|
||||
# Returns a {Cursor}.
|
||||
addCursorAtBufferPosition: (bufferPosition) ->
|
||||
@markBufferPosition(bufferPosition, @getSelectionMarkerAttributes())
|
||||
@getLastSelection().cursor
|
||||
|
||||
# Essential: Add a cursor at the position in screen coordinates.
|
||||
#
|
||||
# Returns a {Cursor}.
|
||||
addCursorAtScreenPosition: (screenPosition) ->
|
||||
@markScreenPosition(screenPosition, @getSelectionMarkerAttributes())
|
||||
@getLastSelection().cursor
|
||||
|
||||
# Essential: Move every cursor up one row in screen coordinates.
|
||||
moveCursorUp: (lineCount) ->
|
||||
@moveCursors (cursor) -> cursor.moveUp(lineCount, moveToEndOfSelection: true)
|
||||
|
||||
Reference in New Issue
Block a user