Mark last cursor for autoscroll on undo/redo

This commit is contained in:
Kevin Sawicki
2013-11-06 09:03:35 -08:00
parent dba7687470
commit 291f4fbb90
3 changed files with 15 additions and 1 deletions

View File

@@ -958,6 +958,16 @@ describe "Editor", ->
editor.insertText('\n\n')
expect(editor.scrollToPixelPosition.callCount).toBe 1
it "autoscrolls on undo/redo", ->
editor.getCursor().clearAutoscroll()
spyOn(editor, 'scrollToPixelPosition').andCallThrough()
editor.insertText('\n\n')
expect(editor.scrollToPixelPosition.callCount).toBe 1
editor.undo()
expect(editor.scrollToPixelPosition.callCount).toBe 2
editor.redo()
expect(editor.scrollToPixelPosition.callCount).toBe 3
describe "when the last cursor exceeds the upper or lower scroll margins", ->
describe "when the editor is taller than twice the vertical scroll margin", ->
it "sets the scrollTop so the cursor remains within the scroll margin", ->