Improved gather candidate while loop
This commit is contained in:
parent
193a769456
commit
c2c224caef
@ -329,16 +329,11 @@ function! s:get_main_recurse(file) " {{{1
|
|||||||
"
|
"
|
||||||
" Gather candidate files
|
" Gather candidate files
|
||||||
"
|
"
|
||||||
let l:maxit = 100
|
|
||||||
let l:path = expand('%:p:h')
|
let l:path = expand('%:p:h')
|
||||||
let l:dirs = l:path
|
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:path = fnamemodify(l:path, ':h')
|
||||||
let l:dirs .= ',' . l:path
|
let l:dirs .= ',' . l:path
|
||||||
let l:maxit -= 1
|
|
||||||
if l:maxir == 0
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
endwhile
|
endwhile
|
||||||
let l:candidates = globpath(l:dirs, '*.tex', 0, 1)
|
let l:candidates = globpath(l:dirs, '*.tex', 0, 1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user