@@ -165,6 +165,14 @@ describe "Snippets extension", ->
165
165
${2:placeholder ending second line}
166
166
"""
167
167
168
+ " tab stops at the ends of snippets" :
169
+ prefix : " t6b"
170
+ body : " $1expanded$0"
171
+
172
+ " tab stops at the ends of snippets - alternative" :
173
+ prefix : " t6c"
174
+ body : " $0expanded$1"
175
+
168
176
" contains empty lines" :
169
177
prefix : " t7"
170
178
body : """
@@ -591,6 +599,28 @@ describe "Snippets extension", ->
591
599
simulateTabKeyEvent ()
592
600
expect (editor .lineTextForBufferRow (0 )).toBe " first line"
593
601
602
+ it " does not remember the tab stops when the whole snippet has been undone (regression)" , ->
603
+ editor .insertText ' t6b\n '
604
+ editor .setCursorBufferPosition [0 , 3 ]
605
+ simulateTabKeyEvent ()
606
+ expect (editor .lineTextForBufferRow (0 )).toBe " expanded"
607
+ editor .undo ()
608
+ expect (editor .lineTextForBufferRow (0 )).toBe " t6b"
609
+ simulateTabKeyEvent ()
610
+ expect (editor .lineTextForBufferRow (0 )).toBe " expanded"
611
+ expect (editor .getCursorBufferPosition ()).toEqual ([0 , 0 ])
612
+
613
+ it " does not remember the tab stops when the whole snippet has been undone (regression, alternative version)" , ->
614
+ editor .insertText ' t6c\n '
615
+ editor .setCursorBufferPosition [0 , 3 ]
616
+ simulateTabKeyEvent ()
617
+ expect (editor .lineTextForBufferRow (0 )).toBe " expanded"
618
+ editor .undo ()
619
+ expect (editor .lineTextForBufferRow (0 )).toBe " t6c"
620
+ simulateTabKeyEvent ()
621
+ expect (editor .lineTextForBufferRow (0 )).toBe " expanded"
622
+ expect (editor .getCursorBufferPosition ()).toEqual ([0 , 8 ])
623
+
594
624
describe " when the prefix contains non-word characters" , ->
595
625
it " selects the non-word characters as part of the prefix" , ->
596
626
editor .insertText (" @unique" )
0 commit comments