diff --git a/plugin/UltiSnips/__init__.py b/plugin/UltiSnips/__init__.py index ba1eb15..7048b93 100644 --- a/plugin/UltiSnips/__init__.py +++ b/plugin/UltiSnips/__init__.py @@ -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 diff --git a/test.py b/test.py index dd3aec6..f7204dd 100755 --- a/test.py +++ b/test.py @@ -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"