diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-05-20 16:59:09 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-05-20 16:59:09 +0200 |
commit | a688c66a049b12e7b19f6ab4cb27c5a24dc3d52c (patch) | |
tree | 4f21330aa69ea67c4b32ad89918034e375bd1e1c /autoload/vimtex/parser | |
parent | 0a7c62b3b22a75f91245a718c1409e4216ae61c8 (diff) | |
download | vim-polyglot-a688c66a049b12e7b19f6ab4cb27c5a24dc3d52c.tar.gz vim-polyglot-a688c66a049b12e7b19f6ab4cb27c5a24dc3d52c.zip |
Update
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, |