diff options
Diffstat (limited to 'autoload/vimtex/parser')
| -rw-r--r-- | autoload/vimtex/parser/toc.vim | 12 | 
1 files changed, 8 insertions, 4 deletions
| diff --git a/autoload/vimtex/parser/toc.vim b/autoload/vimtex/parser/toc.vim index 517a25be..a518ce53 100644 --- a/autoload/vimtex/parser/toc.vim +++ b/autoload/vimtex/parser/toc.vim @@ -154,7 +154,7 @@ let s:re_prefilter = '\v%(\\' . join([        \ 'tableofcontents',        \ 'todo',        \], '|') . ')' -      \ . '|\%\s*%(' . join(g:vimtex_toc_todo_keywords, '|') . ')' +      \ . '|\%\s*%(' . join(keys(g:vimtex_toc_todo_labels), '|') . ')'        \ . '|\%\s*vimtex-include'  for s:m in g:vimtex_toc_custom_matchers    if has_key(s:m, 'prefilter') @@ -513,14 +513,16 @@ endfunction  let s:matcher_todos = {        \ 're' : g:vimtex#re#not_bslash . '\%\s+(' -      \   . join(g:vimtex_toc_todo_keywords, '|') . ')[ :]+\s*(.*)', +      \   . join(keys(g:vimtex_toc_todo_labels), '|') . ')[ :]+\s*(.*)',        \ 'in_preamble' : 1,        \ 'priority' : 2,        \}  function! s:matcher_todos.get_entry(context) abort dict " {{{1    let [l:type, l:text] = matchlist(a:context.line, self.re)[1:2] +  let l:label = g:vimtex_toc_todo_labels[toupper(l:type)] +    return { -        \ 'title'  : toupper(l:type) . ': ' . l:text, +        \ 'title'  : l:label . l:text,          \ 'number' : '',          \ 'file'   : a:context.file,          \ 'line'   : a:context.lnum, @@ -547,8 +549,10 @@ function! s:matcher_todonotes.get_entry(context) abort dict " {{{1      let s:matcher_continue = deepcopy(self)    endif +  let l:label = get(g:vimtex_toc_todo_labels, 'TODO', 'TODO: ') +    return { -        \ 'title'  : 'TODO: ' . title, +        \ 'title'  : l:label . title,          \ 'number' : '',          \ 'file'   : a:context.file,          \ 'line'   : a:context.lnum, | 
