mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
When a snippet expansion is redone, tab stops are restored
This commit is contained in:
@@ -160,6 +160,19 @@ describe "Snippets extension", ->
|
||||
editor.trigger keydownEvent('tab', target: editor[0])
|
||||
expect(buffer.lineForRow(0)).toBe "first line"
|
||||
|
||||
describe "when a snippet expansion is undone and redone", ->
|
||||
it "recreates the snippet's tab stops", ->
|
||||
editor.insertText ' t5\n'
|
||||
editor.setCursorBufferPosition [0, 6]
|
||||
editor.trigger keydownEvent('tab', target: editor[0])
|
||||
expect(buffer.lineForRow(0)).toBe " first line"
|
||||
editor.undo()
|
||||
editor.redo()
|
||||
|
||||
expect(editor.getCursorBufferPosition()).toEqual [0, 14]
|
||||
editor.trigger keydownEvent('tab', target: editor[0])
|
||||
expect(editor.getSelectedBufferRange()).toEqual [[1, 6], [1, 36]]
|
||||
|
||||
describe ".loadSnippetsFile(path)", ->
|
||||
it "loads the snippets in the given file", ->
|
||||
spyOn(fs, 'read').andReturn """
|
||||
|
||||
Reference in New Issue
Block a user