Mercurial > vim
diff src/testdir/test_fold.vim @ 11131:8d9ecf09183a v8.0.0453
patch 8.0.0453: adding fold marker creates new comment
commit https://github.com/vim/vim/commit/025a6b708a9bff54c73fb9c641b980da19e943a9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 12 20:37:21 2017 +0100
patch 8.0.0453: adding fold marker creates new comment
Problem: Adding fold marker creates new comment.
Solution: Use an existing comment if possible. (LemonBoy, closes https://github.com/vim/vim/issues/1549)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 12 Mar 2017 20:45:04 +0100 |
parents | c8b49300c6b7 |
children | 6b26e044b6f5 |
line wrap: on
line diff
--- a/src/testdir/test_fold.vim +++ b/src/testdir/test_fold.vim @@ -168,6 +168,22 @@ func Test_combining_folds_marker() bwipe! endfunc +func Test_folds_marker_in_comment() + new + call setline(1, ['" foo', 'bar', 'baz']) + setl fen fdm=marker + setl com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\" cms=\"%s + norm! zf2j + setl nofen + :1y + call assert_equal(['" foo{{{'], getreg(0,1,1)) + :+2y + call assert_equal(['baz"}}}'], getreg(0,1,1)) + + set foldmethod& + bwipe! +endfunc + func s:TestFoldExpr(lnum) let thisline = getline(a:lnum) if thisline == 'a'