diff --git a/doc/UltiSnips.txt b/doc/UltiSnips.txt index 5797fcd..bd650d8 100644 --- a/doc/UltiSnips.txt +++ b/doc/UltiSnips.txt @@ -1368,6 +1368,7 @@ Contributors listed in chronological order: Keith Welch - paralogiki Zhao Cai - zhaocai John Szakmeister - jszakmeister + Jonas Diemer - diemer 8.2 Snippets *UltiSnips-contrisnippets* diff --git a/plugin/UltiSnips/__init__.py b/plugin/UltiSnips/__init__.py index 5182764..55f9ff4 100644 --- a/plugin/UltiSnips/__init__.py +++ b/plugin/UltiSnips/__init__.py @@ -572,6 +572,10 @@ class SnippetManager(object): before, after = _vim.buf.current_line_splitted snippets = self._snips(before, True) + if len(snippets) == 0: + self._handle_failure(self.backward_trigger) + return True + # Sort snippets alphabetically snippets.sort(key=lambda x: x.trigger) @@ -793,6 +797,8 @@ class SnippetManager(object): """ if trigger.lower() == "": feedkey = "\\" + trigger + elif trigger.lower() == "": + feedkey = "\\" + trigger else: feedkey = None mode = "n"