Ensure full path names for label input files

This commit is contained in:
Karl Yngve Lervåg 2014-07-30 19:10:21 +02:00
parent 3dca9c2615
commit cd923df205

View File

@ -339,12 +339,10 @@ function! s:labels_extract(file) " {{{1
endfunction
function! s:labels_extract_inputs(file) " {{{1
"
" Searches file for \@input{file} entries and returns list of all files.
"
let matches = []
let root = fnamemodify(a:file, ':p:h') . '/'
for line in filter(readfile(a:file), 'v:val =~ ''\\@input{''')
call add(matches, matchstr(line, '{\zs.*\ze}'))
call add(matches, root . matchstr(line, '{\zs.*\ze}'))
endfor
return matches
endfunction