summaryrefslogtreecommitdiffstats
path: root/ftplugin/latextoc.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2014-07-29 13:03:49 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2014-07-29 13:03:49 +0200
commit5f1223fbc5285689db812236c9100329740a805b (patch)
tree58bc6f11540011afb25826c96f65fa35f5687291 /ftplugin/latextoc.vim
parenta59f644d49ee029df48586a6c3c358858f1e6739 (diff)
downloadvim-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.vim7
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)