mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
Cursor *model* clears selection when cursor moves, not the view.
This commit is contained in:
@@ -17,7 +17,6 @@ class CursorView extends View
|
||||
@cursor.on 'change-screen-position', (position, options) =>
|
||||
@updateAppearance()
|
||||
unless options.bufferChange
|
||||
@clearSelection()
|
||||
@removeIdleClassTemporarily()
|
||||
@trigger 'cursor-move', bufferChange: options.bufferChange
|
||||
|
||||
@@ -74,7 +73,3 @@ class CursorView extends View
|
||||
window.clearTimeout(@idleTimeout) if @idleTimeout
|
||||
@removeClass 'idle'
|
||||
_.defer => @addClass 'idle'
|
||||
|
||||
clearSelection: ->
|
||||
if selectionView = @getSelectionView()
|
||||
selectionView.clearSelection() unless selectionView.retainSelection
|
||||
|
||||
@@ -23,6 +23,7 @@ class Cursor
|
||||
setScreenPosition: (screenPosition, options) ->
|
||||
@anchor.setScreenPosition(screenPosition, options)
|
||||
@goalColumn = null
|
||||
@clearSelection()
|
||||
@trigger 'change-screen-position', @getScreenPosition(), bufferChange: false
|
||||
|
||||
getScreenPosition: ->
|
||||
@@ -31,11 +32,16 @@ class Cursor
|
||||
setBufferPosition: (bufferPosition, options) ->
|
||||
@anchor.setBufferPosition(bufferPosition, options)
|
||||
@goalColumn = null
|
||||
@clearSelection()
|
||||
@trigger 'change-screen-position', @getScreenPosition(), bufferChange: false
|
||||
|
||||
getBufferPosition: ->
|
||||
@anchor.getBufferPosition()
|
||||
|
||||
clearSelection: ->
|
||||
if @selection
|
||||
@selection.clear() unless @selection.retainSelection
|
||||
|
||||
getCurrentScreenRow: ->
|
||||
@getScreenPosition().row
|
||||
|
||||
|
||||
Reference in New Issue
Block a user