From fc569e994b219e8deffa103c2da987fd7b1c8630 Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Mon, 28 Nov 2016 15:56:28 +0100 Subject: [PATCH] Recursive main discovery fix Main discovery always ended up starting on the base file when recursing. To fix this we use the file stored in l:file instead of % (current file) --- autoload/vimtex.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vimtex.vim b/autoload/vimtex.vim index 6700c69..237395c 100644 --- a/autoload/vimtex.vim +++ b/autoload/vimtex.vim @@ -637,7 +637,7 @@ function! s:get_main_recurse(...) " {{{1 " " Gather candidate files " - let l:path = expand('%:p:h') + let l:path = fnamemodify(l:file, ':p:h') let l:dirs = l:path while l:path != fnamemodify(l:path, ':h') let l:path = fnamemodify(l:path, ':h')