Fix bug: List snippets didn't work after whitespace.

This commit is contained in:
Holger Rapp 2012-02-01 21:39:33 +01:00
parent 46f3258af9
commit 8dd7720c29
2 changed files with 4 additions and 0 deletions

View File

@ -334,6 +334,7 @@ class Snippet(object):
self._matched = ""
# Don't expand on whitespace
trigger = trigger.lstrip()
if trigger and trigger.rstrip() is not trigger:
return False

View File

@ -1808,6 +1808,9 @@ class _ListAllSnippets(_VimTest):
class ListAllAvailable_NothingTyped_ExceptCorrectResult(_ListAllSnippets):
keys = "" + LS + "3\n"
wanted = "BLAAH"
class ListAllAvailable_SpaceInFront_ExceptCorrectResult(_ListAllSnippets):
keys = " " + LS + "3\n"
wanted = " BLAAH"
class ListAllAvailable_testtyped_ExceptCorrectResult(_ListAllSnippets):
keys = "hallo test" + LS + "2\n"
wanted = "hallo BLAAH"