Clear the goal column when the cursor moves

Previously it was only cleared when changing the position explicitly
and not as a result of the underlying marker changing such as during a
text insertion.

Closes #1295
This commit is contained in:
Kevin Sawicki
2013-12-11 18:01:12 -08:00
parent dda65d82c3
commit 29b85a1bb9
2 changed files with 11 additions and 1 deletions

View File

@@ -28,6 +28,7 @@ class Cursor
return if oldHeadScreenPosition.isEqual(newHeadScreenPosition)
@needsAutoscroll ?= @isLastCursor() and !textChanged
@goalColumn = null
movedEvent =
oldBufferPosition: oldHeadBufferPosition
@@ -50,7 +51,6 @@ class Cursor
# Private:
changePosition: (options, fn) ->
@goalColumn = null
@clearSelection()
@needsAutoscroll = options.autoscroll ? @isLastCursor()
unless fn()