aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Schnitzer2017-03-20 13:45:39 -0300
committerJakob Schnitzer2017-03-20 13:47:09 -0300
commit65665b799b32541f70345b11896430498338075a (patch)
tree13d6e889fc0490c1c3f4a5806a60e90f43b56ae5
parent6357da05215fa95da4049384886e61be817efa74 (diff)
downloadvim-beancount-65665b799b32541f70345b11896430498338075a.tar.gz
deoplete: accounts can contain colons
-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,