Merge pull request #7225 from lpommers/add-remove-cursor-when-there-are-multiple-cursors-if-cmd-clicking-on-it

Add remove cursor when there are multiple cursors and cmd clicking on it
This commit is contained in:
Max Brunsfeld
2015-06-12 10:41:17 -07:00
4 changed files with 44 additions and 7 deletions

View File

@@ -1565,6 +1565,16 @@ class TextEditor extends Model
setCursorBufferPosition: (position, options) ->
@moveCursors (cursor) -> cursor.setBufferPosition(position, options)
# Essential: Get a {Cursor} at given screen coordinates {Point}
#
# * `position` A {Point} or {Array} of `[row, column]`
#
# Returns the first matched {Cursor} or undefined
getCursorAtScreenPosition: (position) ->
for cursor in @cursors
return cursor if cursor.getScreenPosition().isEqual(position)
undefined
# Essential: Get the position of the most recently added cursor in screen
# coordinates.
#