From 72ed5307462da83daaf4dbb4df3c5bb627f9ed88 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Tue, 26 Jul 2011 16:21:39 +0200 Subject: [PATCH] Anonymous triggers with empty trigger string where not expanded after whitespaces. --- plugin/UltiSnips/__init__.py | 2 +- test.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/UltiSnips/__init__.py b/plugin/UltiSnips/__init__.py index 66e5e3d..68f8a86 100644 --- a/plugin/UltiSnips/__init__.py +++ b/plugin/UltiSnips/__init__.py @@ -719,7 +719,7 @@ class SnippetManager(object): before, after = self._get_before_after() snip = Snippet(trigger, value, descr, options, globals) - if snip.matches(before): + if not trigger or snip.matches(before): self._do_snippet(snip, before, after) return True else: diff --git a/test.py b/test.py index 803d3a8..84df059 100755 --- a/test.py +++ b/test.py @@ -2008,6 +2008,11 @@ class Anon_NoTrigger_Simple(_AnonBase): keys = "abc" + EA wanted = "abcsimple expand" +class Anon_NoTrigger_AfterSpace(_AnonBase): + args = '"simple expand"' + keys = "abc " + EA + wanted = "abc simple expand" + class Anon_NoTrigger_Multi(_AnonBase): args = '"simple $1 expand $1 $0"' keys = "abc" + EA + "123" + JF + "456"