mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Ensure the cursor becomes visible when the selection is emptied
(Even if the cursor doesn't move)
This commit is contained in:
@@ -1042,6 +1042,7 @@ describe "EditSession", ->
|
||||
expect(line).toBe " var ort = function(items) {"
|
||||
expect(editSession.getCursorScreenPosition()).toEqual {row: 1, column: 6}
|
||||
expect(changeScreenRangeHandler).toHaveBeenCalled()
|
||||
expect(editSession.getCursor().isVisible()).toBeTruthy()
|
||||
|
||||
describe "when the cursor is at the beginning of a line", ->
|
||||
it "joins it with the line above", ->
|
||||
|
||||
@@ -13,13 +13,13 @@ class Cursor
|
||||
|
||||
constructor: ({@editSession, @marker}) ->
|
||||
@editSession.observeMarker @marker, (e) =>
|
||||
@setVisible(@selection.isEmpty())
|
||||
|
||||
{oldHeadScreenPosition, newHeadScreenPosition} = e
|
||||
{oldHeadBufferPosition, newHeadBufferPosition} = e
|
||||
{bufferChanged} = e
|
||||
|
||||
return if oldHeadScreenPosition.isEqual(newHeadScreenPosition)
|
||||
|
||||
@setVisible(@selection.isEmpty())
|
||||
@needsAutoscroll ?= @isLastCursor() and !bufferChanged
|
||||
|
||||
movedEvent =
|
||||
|
||||
Reference in New Issue
Block a user