aboutsummaryrefslogtreecommitdiffstats
path: root/rplugin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--rplugin/python3/deoplete/sources/beancount.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/rplugin/python3/deoplete/sources/beancount.py b/rplugin/python3/deoplete/sources/beancount.py
index ae6f6e1..0194da3 100644
--- a/rplugin/python3/deoplete/sources/beancount.py
+++ b/rplugin/python3/deoplete/sources/beancount.py
@@ -44,11 +44,13 @@ class Source(Base):
if re.match(r'^\d{4}[/-]\d\d[/-]\d\d \w*$', context['input']):
return [{'word': x, 'kind': 'directive'} for x in DIRECTIVES]
# line that starts with whitespace (-> accounts)
- if re.match(r'^(\s)+\w+$', context['input']):
+ if re.match(r'^(\s)+[\w:]+$', context['input']):
return [{'word': x, 'kind': 'account'} for x in attrs['accounts']]
# directive followed by account
- if re.search(r'(balance|document|note|open|close|pad(\s\S*)?)\s\w+$',
- context['input']):
+ if re.search(
+ r'(balance|document|note|open|close|pad(\s[\w:]+)?)'
+ r'\s[\w:]+$',
+ context['input']):
return [{'word': x, 'kind': 'account'} for x in attrs['accounts']]
# events
if re.search(r'event "[^"]*$', context['input']):
@@ -57,7 +59,7 @@ class Source(Base):
'kind': 'event'
} for x in attrs['events']]
# commodity after number
- if re.search(r'([0-9]+|[0-9][0-9,]+[0-9])(\.[0-9]*)?\s\w+',
+ if re.search(r'\s([0-9]+|[0-9][0-9,]+[0-9])(\.[0-9]*)?\s\w+$',
context['input']):
return [{
'word': x,