diff --git a/spec/app/edit-session-spec.coffee b/spec/app/edit-session-spec.coffee index 9fe4c5b87..e0c161796 100644 --- a/spec/app/edit-session-spec.coffee +++ b/spec/app/edit-session-spec.coffee @@ -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", -> diff --git a/src/app/cursor.coffee b/src/app/cursor.coffee index 5c9b9091c..5708d4bf7 100644 --- a/src/app/cursor.coffee +++ b/src/app/cursor.coffee @@ -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 =