summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_fold.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-09 15:00:52 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-09 15:00:52 +0100
commit4af7259b2b35e85c590d54908fcd248d2c733be8 (patch)
tree5df9467836d8ec86c789c519b639abbdf8c803c7 /src/testdir/test_fold.vim
parent55d46913084745a48749d7ac4f48930852e1d87e (diff)
patch 8.1.0574: 'commentstring' not used when adding fold marker in Cv8.1.0574
Problem: 'commentstring' not used when adding fold marker in C. Solution: Require white space before middle comment part. (mostly by Hirohito Higashi)
Diffstat (limited to 'src/testdir/test_fold.vim')
-rw-r--r--src/testdir/test_fold.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_fold.vim b/src/testdir/test_fold.vim
index f8664d46f1..67e5a48fe6 100644
--- a/src/testdir/test_fold.vim
+++ b/src/testdir/test_fold.vim
@@ -507,6 +507,35 @@ func Test_fold_marker()
enew!
endfunc
+" test create fold markers with C filetype
+func Test_fold_create_marker_in_C()
+ enew!
+ set fdm=marker fdl=9
+ set filetype=c
+
+ let content = [
+ \ '/*',
+ \ ' * comment',
+ \ ' * ',
+ \ ' *',
+ \ ' */',
+ \ 'int f(int* p) {',
+ \ ' *p = 3;',
+ \ ' return 0;',
+ \ '}'
+ \]
+ for c in range(len(content) - 1)
+ bw!
+ call append(0, content)
+ call cursor(c + 1, 1)
+ norm! zfG
+ call assert_equal(content[c] . (c < 4 ? '{{{' : '/*{{{*/'), getline(c + 1))
+ endfor
+
+ set fdm& fdl&
+ enew!
+endfunc
+
" test folding with indent
func Test_fold_indent()
enew!