From 6c4c60fbaab78f2dba481404dccc9adad519e3c2 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 30 Jan 2020 12:56:09 -0500 Subject: [PATCH] Also don't let HTML and dependent syntaxes change 'foldmethod' References https://github.com/tpope/vim-markdown/issues/154 --- syntax/markdown.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/syntax/markdown.vim b/syntax/markdown.vim index 436d94f..8bf373e 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -12,12 +12,13 @@ if !exists('main_syntax') let main_syntax = 'markdown' endif -runtime! syntax/html.vim -unlet! b:current_syntax - if has('folding') let s:foldmethod = &l:foldmethod endif + +runtime! syntax/html.vim +unlet! b:current_syntax + if !exists('g:markdown_fenced_languages') let g:markdown_fenced_languages = [] endif @@ -35,8 +36,10 @@ for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")') endfor unlet! s:type unlet! s:done_include + if exists('s:foldmethod') && s:foldmethod !=# &l:foldmethod let &l:foldmethod = s:foldmethod + unlet s:foldmethod endif if !exists('g:markdown_minlines')