From 5f1223fbc5285689db812236c9100329740a805b Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 29 Jul 2014 13:03:49 +0200 Subject: Major update --- ftplugin/latextoc.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ftplugin/latextoc.vim') diff --git a/ftplugin/latextoc.vim b/ftplugin/latextoc.vim index d5d7e58c..8edf23d1 100644 --- a/ftplugin/latextoc.vim +++ b/ftplugin/latextoc.vim @@ -76,9 +76,14 @@ function! s:TOCActivate(close) execute b:calling_win . 'wincmd w' + let root = fnamemodify(entry['file'], ':h') . '/' let files = [entry['file']] for line in filter(readfile(entry['file']), 'v:val =~ ''\\input{''') - call add(files, matchstr(line, '{\zs.*\ze\(\.tex\)\?}') . '.tex') + let file = matchstr(line, '{\zs.\{-}\ze\(\.tex\)\?}') . '.tex' + if file[0] != '/' + let file = root . file + endif + call add(files, file) endfor " Find section in buffer (or inputted files) -- cgit v1.2.3