From c2c224caef704a6c4a27e8c7a3b42df21b520d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Thu, 17 Jul 2014 18:43:44 +0200 Subject: [PATCH] Improved gather candidate while loop --- autoload/latex.vim | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/autoload/latex.vim b/autoload/latex.vim index 8a40a1e..94bcade 100644 --- a/autoload/latex.vim +++ b/autoload/latex.vim @@ -329,16 +329,11 @@ function! s:get_main_recurse(file) " {{{1 " " Gather candidate files " - let l:maxit = 100 let l:path = expand('%:p:h') let l:dirs = l:path - while l:path !~ '\v^([A-Z]:)?\/$' + while l:path != fnamemodify(l:path, ':h') let l:path = fnamemodify(l:path, ':h') let l:dirs .= ',' . l:path - let l:maxit -= 1 - if l:maxir == 0 - break - endif endwhile let l:candidates = globpath(l:dirs, '*.tex', 0, 1)