fix for correct error reporting

This commit is contained in:
Stanislav Seletskiy 2015-05-01 18:02:20 +06:00
parent 2f355c233f
commit 463e68a611
2 changed files with 18 additions and 2 deletions

View File

@ -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):

View File

@ -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"