Mercurial > vim
diff src/testdir/test_fold.vim @ 15127:31a0127813cb v8.1.0574
patch 8.1.0574: 'commentstring' not used when adding fold marker in C
commit https://github.com/vim/vim/commit/4af7259b2b35e85c590d54908fcd248d2c733be8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 9 15:00:52 2018 +0100
patch 8.1.0574: 'commentstring' not used when adding fold marker in C
Problem: 'commentstring' not used when adding fold marker in C.
Solution: Require white space before middle comment part. (mostly by
Hirohito Higashi)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 09 Dec 2018 15:15:06 +0100 |
parents | 6e9f37bf987b |
children | 9c90cf08cfa8 |
line wrap: on
line diff
--- 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!