mirror of
https://github.com/atom/atom.git
synced 2026-02-17 10:01:25 -05:00
Tab stops are associated with anchors so we can jump to them event when the buffer changes
This commit is contained in:
@@ -47,8 +47,13 @@ describe "Snippets extension", ->
|
||||
expect(buffer.lineForRow(1)).toBe "go here first:()"
|
||||
expect(buffer.lineForRow(2)).toBe "var quicksort = function () {"
|
||||
expect(editor.getCursorScreenPosition()).toEqual [1, 15]
|
||||
|
||||
editor.trigger keydownEvent('tab', target: editor[0])
|
||||
expect(editor.getCursorScreenPosition()).toEqual [0, 14]
|
||||
editor.insertText 'abc'
|
||||
|
||||
editor.trigger keydownEvent('tab', target: editor[0])
|
||||
expect(editor.getCursorScreenPosition()).toEqual [0, 40]
|
||||
|
||||
describe "when the letters preceding the cursor don't match a snippet", ->
|
||||
it "inserts a tab as normal", ->
|
||||
@@ -108,7 +113,7 @@ describe "Snippets extension", ->
|
||||
snippet = snippets['t1']
|
||||
expect(snippet.body).toBe """
|
||||
go here next:() and finally go here:()
|
||||
go here first:()\n
|
||||
go here first:()
|
||||
"""
|
||||
|
||||
expect(snippet.tabStops).toEqual [[1, 15], [0, 14], [0, 37]]
|
||||
|
||||
Reference in New Issue
Block a user