fixed file not found in autocompleter, issue #30

This commit is contained in:
Paul Gauthier 2023-07-04 12:38:36 -07:00
parent 4373006137
commit 5d18ebd724
2 changed files with 8 additions and 5 deletions

View file

@ -39,8 +39,11 @@ class AutoCompleter(Completer):
self.words.add(rel_fname)
fname = os.path.join(root, rel_fname)
with open(fname, "r") as f:
content = f.read()
try:
with open(fname, "r") as f:
content = f.read()
except FileNotFoundError:
continue
try:
lexer = guess_lexer_for_filename(fname, content)
except ClassNotFound: