Fixed a bug when tabstop zero was deleted and then a jump attemted

This commit is contained in:
Holger Rapp 2012-02-12 08:14:21 +01:00
parent 1b904ea637
commit 6d6fe9dbb6
2 changed files with 6 additions and 2 deletions

View File

@ -93,7 +93,7 @@ class SnippetInstance(EditableTextObject):
res = self._get_next_tab(self._cts)
if res is None:
self._cts = None
return self._tabstops[0]
return self._tabstops.get(0, None)
else:
self._cts, ts = res
return ts

View File

@ -2546,10 +2546,14 @@ class JumpForward_DefSnippet(_VimTest):
snippets = ("test", "${1}\n`!p snip.rv = '\\n'.join(t[1].split())`\n\n${0:pass}")
keys = "test" + EX + "a b c" + JF + "shallnot" + JF + "end"
wanted = "a b c\na\nb\nc\n\nshallnotend"
class DeleteSnippetInsertion(_VimTest):
class DeleteSnippetInsertion0(_VimTest):
snippets = ("test", "${1:hello} $1")
keys = "test" + EX + ESC + "Vkx" + "i\nworld\n"
wanted = "world"
class DeleteSnippetInsertion1(_VimTest):
snippets = ("test", r"$1${1/(.*)/(?0::.)/}")
keys = "test" + EX + ESC + "u" + "i" + JF + "\t"
wanted = "\t"
# End: Undo of Snippet insertion #}}}
# Tab Completion of Words {{{#