From a688c66a049b12e7b19f6ab4cb27c5a24dc3d52c Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 20 May 2020 16:59:09 +0200 Subject: Update --- autoload/vimtex/parser/toc.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'autoload/vimtex/parser/toc.vim') 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, -- cgit v1.2.3