diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-05-12 23:38:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-12 23:38:26 +0800 |
| commit | a200ce0d8580f40a36c313a26db2377c1812abe2 (patch) | |
| tree | 5f684b1534af60fb3822d4e1082fda74c34fff8f /src/nvim/testdir | |
| parent | 8fba428bc6f36ae038a9286517e15b33257a1359 (diff) | |
| download | rneovim-a200ce0d8580f40a36c313a26db2377c1812abe2.tar.gz rneovim-a200ce0d8580f40a36c313a26db2377c1812abe2.tar.bz2 rneovim-a200ce0d8580f40a36c313a26db2377c1812abe2.zip | |
vim-patch:8.2.4941: '[ and '] marks may be wrong after undo (#18539)
Problem: '[ and '] marks may be wrong after undo.
Solution: Adjust the '[ and '] marks if needed. (closes vim/vim#10407, closes vim/vim#1281)
https://github.com/vim/vim/commit/82444cefa3fef87624a078ea86a72af7ef4ef42e
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_undo.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_undo.vim b/src/nvim/testdir/test_undo.vim index 30e00e7ad4..848860649e 100644 --- a/src/nvim/testdir/test_undo.vim +++ b/src/nvim/testdir/test_undo.vim @@ -733,4 +733,21 @@ func Test_undofile_cryptmethod_blowfish2() set undofile& undolevels& cryptmethod& endfunc +func Test_undo_mark() + new + " The undo is applied to the only line. + call setline(1, 'hello') + call feedkeys("ggyiw$p", 'xt') + undo + call assert_equal([0, 1, 1, 0], getpos("'[")) + call assert_equal([0, 1, 1, 0], getpos("']")) + " The undo removes the last line. + call feedkeys("Goaaaa\<Esc>", 'xt') + call feedkeys("obbbb\<Esc>", 'xt') + undo + call assert_equal([0, 2, 1, 0], getpos("'[")) + call assert_equal([0, 2, 1, 0], getpos("']")) + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |