fix not cleared context
This commit is contained in:
parent
3c4ac11af3
commit
bdecd9a8b5
@ -242,6 +242,7 @@ class SnippetDefinition(object):
|
||||
self._matched = ''
|
||||
return False
|
||||
|
||||
self._context = None
|
||||
if match and self._context_code:
|
||||
self._context = self._context_match()
|
||||
if not self.context:
|
||||
|
@ -138,3 +138,14 @@ class ContextSnippets_CursorIsZeroBased(_VimTest):
|
||||
|
||||
keys = "e" + EX
|
||||
wanted = "(2, 1)"
|
||||
|
||||
class ContextSnippets_ContextIsClearedBeforeExpand(_VimTest):
|
||||
files = { 'us/all.snippets': r"""
|
||||
pre_expand "snip.context = 1 if snip.context is None else 2"
|
||||
snippet e "desc" w
|
||||
`!p snip.rv = str(snip.context)`
|
||||
endsnippet
|
||||
"""}
|
||||
|
||||
keys = "e" + EX + " " + "e" + EX
|
||||
wanted = "1 1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user