Skip to content

Commit

Permalink
Rename _must_refresh -> must_ensure
Browse files Browse the repository at this point in the history
Remove the underscore since it's accessed in the manager class.
  • Loading branch information
mg979 committed Mar 7, 2024
1 parent 181f42e commit d0c039e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pythonx/UltiSnips/snippet/source/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SnippetSource:
def __init__(self):
self._snippets = defaultdict(SnippetDictionary)
self._extends = defaultdict(set)
self._must_refresh = True
self.must_ensure = True

def ensure(self, filetypes):
"""Ensures that snippets are loaded."""
Expand Down
4 changes: 2 additions & 2 deletions pythonx/UltiSnips/snippet/source/file/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def __init__(self):
SnippetSource.__init__(self)

def ensure(self, filetypes):
if self._must_refresh:
if self.must_ensure:
for ft in self.get_deep_extends(filetypes):
if self._needs_update(ft):
self._load_snippets_for(ft)
self._must_refresh = False
self.must_ensure = False

def refresh(self):
self.__init__()
Expand Down
2 changes: 1 addition & 1 deletion pythonx/UltiSnips/snippet_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ def _check_filetype(self, ft):
if ft not in self._filetypes:
self._filetypes.append(ft)
for _, source in self._snippet_sources:
source._must_refresh = True
source.must_ensure = True


UltiSnips_Manager = SnippetManager( # pylint:disable=invalid-name
Expand Down

0 comments on commit d0c039e

Please # to comment.