aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rplugin/python3/deoplete/sources/beancount.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/rplugin/python3/deoplete/sources/beancount.py b/rplugin/python3/deoplete/sources/beancount.py
index 0194da3..c29b767 100644
--- a/rplugin/python3/deoplete/sources/beancount.py
+++ b/rplugin/python3/deoplete/sources/beancount.py
@@ -33,7 +33,9 @@ class Source(Base):
self.error('Importing beancount failed.')
def on_event(self, context):
- self.__make_cache(context)
+ if context['event'] in ('Init', 'BufWritePost'):
+ # Make cache on BufNewFile, BufRead, and BufWritePost
+ self.__make_cache(context)
def get_complete_position(self, context):
m = re.search(r'\S*$', context['input'])