From ecfe0fbbf3b1f47e37637d7c17be86c1cd635738 Mon Sep 17 00:00:00 2001 From: Julio B Date: Tue, 19 Sep 2023 02:07:49 +0300 Subject: [PATCH] fix: preamble toc matcher bug introduced in d5062045a1 fixes: #2787 --- autoload/vimtex/parser/toc/preamble.vim | 2 +- test/test-toc/test-disable.vim | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/vimtex/parser/toc/preamble.vim b/autoload/vimtex/parser/toc/preamble.vim index f99bb95402..63247e3a6f 100644 --- a/autoload/vimtex/parser/toc/preamble.vim +++ b/autoload/vimtex/parser/toc/preamble.vim @@ -11,7 +11,7 @@ endfunction " }}}1 let s:matcher = { - \ 'disabled' : !g:vimtex_toc_show_preamble, + \ 'disable' : !g:vimtex_toc_show_preamble, \ 'in_preamble' : 1, \ 'in_content' : 0, \ 'prefilter_cmds' : ['documentclass'], diff --git a/test/test-toc/test-disable.vim b/test/test-toc/test-disable.vim index f54383bd9c..debb31e8bb 100644 --- a/test/test-toc/test-disable.vim +++ b/test/test-toc/test-disable.vim @@ -4,6 +4,7 @@ filetype plugin on nnoremap q :qall! +let g:vimtex_toc_show_preamble = 0 let g:vimtex_toc_config_matchers = { \ 'beamer_frame': {'disable': 1} \} @@ -14,7 +15,8 @@ if empty($INMAKE) | finish | endif let s:toc = vimtex#toc#get_entries() -call assert_equal(5, len(s:toc)) +call assert_equal(4, len(s:toc)) +call assert_notequal('Preamble', s:toc[0].title) call assert_equal('Conclusion', s:toc[-1].title) call vimtex#test#finished()