diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2014-07-29 13:03:49 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2014-07-29 13:03:49 +0200 |
commit | 5f1223fbc5285689db812236c9100329740a805b (patch) | |
tree | 58bc6f11540011afb25826c96f65fa35f5687291 /ftplugin/latextoc.vim | |
parent | a59f644d49ee029df48586a6c3c358858f1e6739 (diff) | |
download | vim-polyglot-1.9.2.tar.gz vim-polyglot-1.9.2.zip |
Major updatev1.9.2
Diffstat (limited to 'ftplugin/latextoc.vim')
-rw-r--r-- | ftplugin/latextoc.vim | 7 |
1 files changed, 6 insertions, 1 deletions
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) |