diff options
author | Jakob Schnitzer | 2016-11-21 10:21:57 +0100 |
---|---|---|
committer | Jakob Schnitzer | 2016-11-21 10:21:57 +0100 |
commit | 81e9f05e3a1eac547813b7d80bf7417f38be8346 (patch) | |
tree | bba96bd7fd79bbca27c1258be94a39b518397218 | |
parent | 11b166d9efb5e0f51a1fad42fe62e5c867d4a6db (diff) | |
download | vim-beancount-81e9f05e3a1eac547813b7d80bf7417f38be8346.tar.gz |
deoplete: use b:beancount_root
Diffstat (limited to '')
-rw-r--r-- | autoload/beancount.vim | 14 | ||||
-rw-r--r-- | rplugin/python3/deoplete/sources/beancount.py | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/autoload/beancount.vim b/autoload/beancount.vim index 9d18252..e262f11 100644 --- a/autoload/beancount.vim +++ b/autoload/beancount.vim @@ -113,7 +113,7 @@ function! beancount#complete(findstart, base) endif endfunction -function! s:get_root() +function! beancount#get_root() if exists('b:beancount_root') return b:beancount_root endif @@ -122,7 +122,7 @@ endfunction function! beancount#load_everything() if s:using_python3 && !exists('b:beancount_loaded') - let l:root = s:get_root() + let l:root = beancount#get_root() python3 << EOF import vim from beancount import loader @@ -166,35 +166,35 @@ endfunction function! beancount#load_accounts() if !s:using_python3 && !exists('b:beancount_accounts') - let l:root = s:get_root() + let l:root = beancount#get_root() let b:beancount_accounts = beancount#find_accounts(l:root) endif endfunction function! beancount#load_tags() if !s:using_python3 && !exists('b:beancount_tags') - let l:root = s:get_root() + let l:root = beancount#get_root() let b:beancount_tags = beancount#find_tags(l:root) endif endfunction function! beancount#load_links() if !s:using_python3 && !exists('b:beancount_links') - let l:root = s:get_root() + let l:root = beancount#get_root() let b:beancount_links = beancount#find_links(l:root) endif endfunction function! beancount#load_currencies() if !s:using_python3 && !exists('b:beancount_currencies') - let l:root = s:get_root() + let l:root = beancount#get_root() let b:beancount_currencies = beancount#find_currencies(l:root) endif endfunction function! beancount#load_payees() if !s:using_python3 && !exists('b:beancount_payees') - let l:root = s:get_root() + let l:root = beancount#get_root() let b:beancount_payees = beancount#find_payees(l:root) endif endfunction diff --git a/rplugin/python3/deoplete/sources/beancount.py b/rplugin/python3/deoplete/sources/beancount.py index 4618105..f595a54 100644 --- a/rplugin/python3/deoplete/sources/beancount.py +++ b/rplugin/python3/deoplete/sources/beancount.py @@ -54,7 +54,7 @@ class Source(Base): payees = set() tags = set() if HAS_BEANCOUNT: - entries, _, _ = load_file(self.vim.eval("expand('%')")) + entries, _, _ = load_file(self.vim.eval("beancount#get_root()")) else: entries = [] |