diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-12 07:43:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-12 07:43:36 +0800 |
commit | eee956051637a5dff02ba6c6083fbffc87c0c96e (patch) | |
tree | bd08a4983f10ffe914ce0c668e1d7b4a5ed4337d /src/nvim/testdir | |
parent | 0d7cc5ee85c2722ab68e276a2bfda336ef9429d5 (diff) | |
download | rneovim-eee956051637a5dff02ba6c6083fbffc87c0c96e.tar.gz rneovim-eee956051637a5dff02ba6c6083fbffc87c0c96e.tar.bz2 rneovim-eee956051637a5dff02ba6c6083fbffc87c0c96e.zip |
vim-patch:9.0.0861: solution for "!!sort" in closed fold is not optimal (#21027)
Problem: Solution for "!!sort" in closed fold is not optimal.
Solution: Use a different range instead of the subtle difference in handling
a range with an offset. (issue vim/vim#11487)
https://github.com/vim/vim/commit/9954dc39ea090cee6bf41c888c41e60d9f52c3b8
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_fold.vim | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_fold.vim b/src/nvim/testdir/test_fold.vim index 1ee9165308..1b979dbc03 100644 --- a/src/nvim/testdir/test_fold.vim +++ b/src/nvim/testdir/test_fold.vim @@ -72,6 +72,54 @@ func Test_address_fold() quit! endfunc +func Test_address_offsets() + " check the help for :range-closed-fold + enew + call setline(1, [ + \ '1 one', + \ '2 two', + \ '3 three', + \ '4 four FOLDED', + \ '5 five FOLDED', + \ '6 six', + \ '7 seven', + \ '8 eight', + \]) + set foldmethod=manual + normal 4Gvjzf + 3,4+2yank + call assert_equal([ + \ '3 three', + \ '4 four FOLDED', + \ '5 five FOLDED', + \ '6 six', + \ '7 seven', + \ ], getreg(0,1,1)) + + enew! + call setline(1, [ + \ '1 one', + \ '2 two', + \ '3 three FOLDED', + \ '4 four FOLDED', + \ '5 five FOLDED', + \ '6 six FOLDED', + \ '7 seven', + \ '8 eight', + \]) + normal 3Gv3jzf + 2,4-1yank + call assert_equal([ + \ '2 two', + \ '3 three FOLDED', + \ '4 four FOLDED', + \ '5 five FOLDED', + \ '6 six FOLDED', + \ ], getreg(0,1,1)) + + bwipe! +endfunc + func Test_indent_fold() new call setline(1, ['', 'a', ' b', ' c']) |