mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
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:
@@ -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.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user