From 6df2d66f145edbb010a0f8468bded18d4cad2077 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Tue, 8 Jul 2014 10:36:13 +0200 Subject: [PATCH 1/1] Fix toc consfuses hyphen list with Setex header. Fix #100. --- ftplugin/mkd.vim | 2 +- test/header.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ftplugin/mkd.vim b/ftplugin/mkd.vim index 36d0b08..4744512 100644 --- a/ftplugin/mkd.vim +++ b/ftplugin/mkd.vim @@ -302,7 +302,7 @@ function! s:Markdown_Toc(...) endif try - silent vimgrep /\(^\S.*\(\n[=-]\+\)\@=\|^#\+\)/ % + silent vimgrep /\(^\S.*\(\n[=-]\+\n\)\@=\|^#\+\)/ % catch /E480/ echom "Toc: No headers." return diff --git a/test/header.md b/test/header.md index 084eef3..7e19083 100644 --- a/test/header.md +++ b/test/header.md @@ -58,6 +58,11 @@ setex h1 single punctuation setex h1 punctuation longer than header ================================ +Prevent list vs Setex confusion: + +- not Setex +- because list + --- Mixed tests. -- 2.39.5