From: Hiroshi Shirosaki Date: Thu, 14 Jan 2016 06:38:00 +0000 (+0900) Subject: Escape `~` in regexp with folding X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/1ec89a223c39af3eb4dbf4aff2698878cb03aa9c?ds=sidebyside;hp=-c Escape `~` in regexp with folding Add tests for `~` --- 1ec89a223c39af3eb4dbf4aff2698878cb03aa9c diff --git a/after/ftplugin/markdown.vim b/after/ftplugin/markdown.vim index 84b6a4f..06a1583 100644 --- a/after/ftplugin/markdown.vim +++ b/after/ftplugin/markdown.vim @@ -54,7 +54,7 @@ else let l0 = getline(a:lnum-1) endif " keep track of fenced code blocks - if l0 =~ '````*' || l0 =~ '~~~~*' + if l0 =~ '````*' || l0 =~ '\~\~\~\~*' if b:fenced_block == 0 let b:fenced_block = 1 elseif b:fenced_block == 1 diff --git a/test/folding-toc.vader b/test/folding-toc.vader index a02f1c2..950d8cd 100644 --- a/test/folding-toc.vader +++ b/test/folding-toc.vader @@ -29,7 +29,7 @@ echo "foo" ~~~~bash mkdir foo -cd foo +# comment in ~ ~~~~ ### chap 1.1.1 @@ -74,6 +74,7 @@ Execute (fold level): AssertEqual foldlevel(7), 1, '# some bash scripting' AssertEqual foldlevel(15), 1, '## chap 1.1' AssertEqual foldlevel(21), 2, 'mkdir foo' + AssertEqual foldlevel(22), 2, 'comment in ~' AssertEqual foldlevel(25), 2, '### chap 1.1.1' AssertEqual foldlevel(27), 3, '- dragons' AssertEqual foldlevel(30), 1, '# chap 2'