mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-29 09:34:58 +03:00
Add asserts for undoing an insertNewlineAbove
This commit is contained in:
parent
867a6ecd95
commit
60fa937ed7
@ -1353,13 +1353,16 @@ describe "EditSession", ->
|
|||||||
|
|
||||||
describe "when the cursor is not on the first line", ->
|
describe "when the cursor is not on the first line", ->
|
||||||
it "inserts a newline above the current line and moves the cursor to the inserted line", ->
|
it "inserts a newline above the current line and moves the cursor to the inserted line", ->
|
||||||
editSession.setCursorBufferPosition([3])
|
editSession.setCursorBufferPosition([3,4])
|
||||||
editSession.insertNewlineAbove()
|
editSession.insertNewlineAbove()
|
||||||
expect(editSession.getCursorBufferPosition()).toEqual [3,0]
|
expect(editSession.getCursorBufferPosition()).toEqual [3,0]
|
||||||
expect(editSession.lineForBufferRow(3)).toBe ''
|
expect(editSession.lineForBufferRow(3)).toBe ''
|
||||||
expect(editSession.lineForBufferRow(4)).toBe ' var pivot = items.shift(), current, left = [], right = [];'
|
expect(editSession.lineForBufferRow(4)).toBe ' var pivot = items.shift(), current, left = [], right = [];'
|
||||||
expect(editSession.buffer.getLineCount()).toBe 14
|
expect(editSession.buffer.getLineCount()).toBe 14
|
||||||
|
|
||||||
|
editSession.undo()
|
||||||
|
expect(editSession.getCursorBufferPosition()).toEqual [3,4]
|
||||||
|
|
||||||
describe ".backspace()", ->
|
describe ".backspace()", ->
|
||||||
describe "when there is a single cursor", ->
|
describe "when there is a single cursor", ->
|
||||||
changeScreenRangeHandler = null
|
changeScreenRangeHandler = null
|
||||||
|
Loading…
Reference in New Issue
Block a user