From 4bc6ff454739efae4f20a4f031f8831014c93fe1 Mon Sep 17 00:00:00 2001 From: Rane Brown Date: Wed, 16 Oct 2019 22:31:42 -0600 Subject: [PATCH] Exclude code block comments from header folding. This makes sure comment characters that match markdown folding are not recognized as a header and folder. Fixes #212, Fixes #756. --- doc/vimwiki.txt | 2 ++ ftplugin/vimwiki.vim | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index cedf960..3e8b15b 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -3546,6 +3546,8 @@ Removed:~ point. Fixed:~ + * Issue #212: Don't treat comment characters within code blocks as + headers. * PR #744: Fix typo in vimwiki_list_manipulation * Issue #715: s:clean_url is compatible with vim pre 7.4.1546 (sticky type checking) diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index f2fc48e..685a246 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -143,7 +143,7 @@ function! VimwikiFoldLevel(lnum) let line = getline(a:lnum) " Header/section folding... - if line =~# vimwiki#vars#get_syntaxlocal('rxHeader') + if line =~# vimwiki#vars#get_syntaxlocal('rxHeader') && !vimwiki#u#is_codeblock(a:lnum) return '>'.vimwiki#u#count_first_sym(line) " Code block folding... elseif line =~# vimwiki#vars#get_syntaxlocal('rxPreStart')