From 01b48d2a0aede777f508eaed90d6716ecab5b1f8 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Thu, 28 Aug 2014 14:44:23 -0700 Subject: [PATCH] Move adding cursor functions under more heavily used functions --- src/editor.coffee | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/editor.coffee b/src/editor.coffee index aac77bda1..c24a7bc76 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -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)