Fix #286 - TOC sections with optional args
This commit is contained in:
parent
af3f0f2226
commit
6fe6bac1a4
@ -58,7 +58,7 @@ function! vimtex#toc#init_script() " {{{1
|
||||
\ }
|
||||
|
||||
" Define regular expressions to match document parts
|
||||
let s:re_sec = '\v^\s*\\%(part|chapter|%(sub)*section)\*?\s*\{'
|
||||
let s:re_sec = '\v^\s*\\%(part|chapter|%(sub)*section)\*?\s*%(\[.{-}\])?\{'
|
||||
let s:re_sec_starred = '\v^\s*\\%(part|chapter|%(sub)*section)\*'
|
||||
let s:re_sec_level = '\v^\s*\\\zs%(part|chapter|%(sub)*section)'
|
||||
let s:re_sec_title = s:re_sec . '\zs.{-}\ze\}?$'
|
||||
|
@ -3,6 +3,6 @@ Preface.
|
||||
|
||||
\section{Acknowledgements}
|
||||
|
||||
\chapter{Other frontmatter chapter}
|
||||
\chapter[Other]{Other frontmatter chapter}
|
||||
|
||||
\tableofcontents
|
||||
|
Loading…
Reference in New Issue
Block a user