diff --git a/pythonx/UltiSnips/snippet/source/file/_base.py b/pythonx/UltiSnips/snippet/source/file/_base.py index 33754ec..6e639a0 100644 --- a/pythonx/UltiSnips/snippet/source/file/_base.py +++ b/pythonx/UltiSnips/snippet/source/file/_base.py @@ -69,8 +69,12 @@ class SnippetFileSource(SnippetSource): if ft in self._snippets: del self._snippets[ft] del self._extends[ft] - for fn in self._files_for_ft[ft]: - self._parse_snippets(ft, fn) + try: + for fn in self._files_for_ft[ft]: + self._parse_snippets(ft, fn) + except: + del self._files_for_ft[ft] + raise # Now load for the parents for parent_ft in self.get_deep_extends([ft]): if parent_ft != ft and self._needs_update(parent_ft): diff --git a/test/test_ContextSnippets.py b/test/test_ContextSnippets.py index ae5a77f..f3819e7 100644 --- a/test/test_ContextSnippets.py +++ b/test/test_ContextSnippets.py @@ -101,3 +101,15 @@ class ContextSnippets_PriorityKeyword(_VimTest): keys = "i" + EX wanted = "b" + + +class ContextSnippets_ReportError(_VimTest): + files = { 'us/all.snippets': r""" + snippet e "desc" "Tru" e + error + endsnippet + """} + + keys = "e" + EX + wanted = "e" + EX + expected_error = r"NameError: name 'Tru' is not defined"