From 06820bf116da25bf9fc44f7091c3e9bcc5e972b1 Mon Sep 17 00:00:00 2001 From: Hiroshi Shirosaki Date: Thu, 21 Jan 2016 18:04:42 +0900 Subject: [PATCH 1/1] Reduce unnecessary call `matchend()` Do not call `matchend()` if `s:vim_markdown_folding_level == 1`. --- after/ftplugin/markdown.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/after/ftplugin/markdown.vim b/after/ftplugin/markdown.vim index 5c51126..6265db3 100644 --- a/after/ftplugin/markdown.vim +++ b/after/ftplugin/markdown.vim @@ -124,8 +124,7 @@ else let l1 = getline(a:lnum) if l1 =~ '^#' && !s:is_mkdCode(a:lnum) " fold level according to option - let l:level = matchend(l1, '^#\+') - if s:vim_markdown_folding_level == 1 || l:level > s:vim_markdown_folding_level + if s:vim_markdown_folding_level == 1 || matchend(l1, '^#\+') > s:vim_markdown_folding_level return -1 else " headers are not folded -- 2.39.5