From 256fc0c2bcb83c87897b659262bea2a6d417afa2 Mon Sep 17 00:00:00 2001 From: patricknraanes Date: Wed, 3 Mar 2021 15:35:36 +0100 Subject: [PATCH 1/2] pushd/popd root when parsing bib for context menu --- autoload/vimtex/context/cite.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/vimtex/context/cite.vim b/autoload/vimtex/context/cite.vim index f30f6dca60..3b9daedb09 100644 --- a/autoload/vimtex/context/cite.vim +++ b/autoload/vimtex/context/cite.vim @@ -39,10 +39,13 @@ endfunction " }}}1 function! s:handler.get_actions() abort dict " {{{1 + " Work in root, as in completer_bib.gather_candidates + call vimtex#paths#pushd(b:vimtex.root) let l:entries = [] for l:file in vimtex#bib#files() let l:entries += vimtex#parser#bib(l:file, {'backend': 'vim'}) endfor + call vimtex#paths#popd() let l:entry = get( \ filter(copy(l:entries), {_, x -> x.key ==# self.selected}), 0, {}) From 2a8f88069268cc3b0bdaffdcd2ac1b23d3114b3b Mon Sep 17 00:00:00 2001 From: patricknraanes Date: Thu, 4 Mar 2021 09:43:55 +0100 Subject: [PATCH 2/2] Address review: improve comment --- autoload/vimtex/context/cite.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vimtex/context/cite.vim b/autoload/vimtex/context/cite.vim index 3b9daedb09..4fc4549d80 100644 --- a/autoload/vimtex/context/cite.vim +++ b/autoload/vimtex/context/cite.vim @@ -39,7 +39,7 @@ endfunction " }}}1 function! s:handler.get_actions() abort dict " {{{1 - " Work in root, as in completer_bib.gather_candidates + " Ensure we're at the root directory when locating bib files call vimtex#paths#pushd(b:vimtex.root) let l:entries = [] for l:file in vimtex#bib#files()