From 610f4c570123510f2d6f4c5799d880d8581126cf Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 15 Apr 2014 01:05:44 +0200 Subject: Update --- ftplugin/latextoc.vim | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'ftplugin/latextoc.vim') diff --git a/ftplugin/latextoc.vim b/ftplugin/latextoc.vim index 48f20e3b..01fd9bb0 100644 --- a/ftplugin/latextoc.vim +++ b/ftplugin/latextoc.vim @@ -40,13 +40,9 @@ endfunction " {{{2 EscapeTitle function! s:EscapeTitle(titlestr) - " Credit goes to Marcin Szamotulski for the following fix. It allows to - " match through commands added by TeX. - let titlestr = substitute(a:titlestr, '\\\w*\>\s*\%({[^}]*}\)\?', '.*', 'g') - - let titlestr = escape(titlestr, '\') - let titlestr = substitute(titlestr, ' ', '\\_\\s\\+', 'g') - + let titlestr = substitute(a:titlestr, '\\[a-zA-Z@]*\>\s*{\?', '.*', 'g') + let titlestr = substitute(titlestr, '}', '', 'g') + let titlestr = substitute(titlestr, '\%(\.\*\s*\)\{2,}', '.*', 'g') return titlestr endfunction @@ -170,6 +166,7 @@ function! s:TOCOpenBuf(file) let bnr = bufnr(a:file) endif execute 'buffer! ' . bnr + normal! gg endfunction -- cgit v1.2.3