Improved gather candidate while loop

This commit is contained in:
Karl Yngve Lervåg 2014-07-17 18:43:44 +02:00
parent 193a769456
commit c2c224caef

View File

@ -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)