diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-11-11 10:16:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-11 10:16:26 +0800 |
| commit | ae67706535b23233d2d6f5a81b7c7284c3cc16f9 (patch) | |
| tree | 4ac869fe25e98a43433eacb5e85ca7be1a3d5f60 /src/nvim/testdir | |
| parent | 69507c0204cfe284e42865c9c89baec0f351b2c1 (diff) | |
| download | rneovim-ae67706535b23233d2d6f5a81b7c7284c3cc16f9.tar.gz rneovim-ae67706535b23233d2d6f5a81b7c7284c3cc16f9.tar.bz2 rneovim-ae67706535b23233d2d6f5a81b7c7284c3cc16f9.zip | |
vim-patch:9.0.0858: "!!sort" in a closed fold sorts too many lines (#21022)
Problem: "!!sort" in a closed fold sorts too many lines.
Solution: Round to end of fold after adding the line count. (closes vim/vim#11487)
https://github.com/vim/vim/commit/f00112d558eb9a7d1d5413c096960ddcc52c9f66
N/A patches for version.c:
vim-patch:9.0.0855: comment not located above the code it refers to
Problem: Comment not located above the code it refers to.
Solution: Move the comment. (closes vim/vim#11527)
https://github.com/vim/vim/commit/09a93e3e66689c691a00fce25e4ce310d81edaee
vim-patch:9.0.0859: compiler warning for unused variable
Problem: Compiler warning for unused variable.
Solution: Add #ifdef.
https://github.com/vim/vim/commit/fd3084b6e298477dec4979515c6b4a8a3c3beeb2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_fold.vim | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_fold.vim b/src/nvim/testdir/test_fold.vim index 832dd43b65..1ee9165308 100644 --- a/src/nvim/testdir/test_fold.vim +++ b/src/nvim/testdir/test_fold.vim @@ -986,4 +986,40 @@ func Test_indent_append_blank_small_fold_close() bw! endfunc +func Test_sort_closed_fold() + CheckExecutable sort + + call setline(1, [ + \ 'Section 1', + \ ' how', + \ ' now', + \ ' brown', + \ ' cow', + \ 'Section 2', + \ ' how', + \ ' now', + \ ' brown', + \ ' cow', + \]) + setlocal foldmethod=indent sw=3 + normal 2G + + " The "!!" expands to ".,.+3" and must only sort four lines + call feedkeys("!!sort\<CR>", 'xt') + call assert_equal([ + \ 'Section 1', + \ ' brown', + \ ' cow', + \ ' how', + \ ' now', + \ 'Section 2', + \ ' how', + \ ' now', + \ ' brown', + \ ' cow', + \ ], getline(1, 10)) + + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |