aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-04 07:05:05 +0800
committerGitHub <noreply@github.com>2025-03-04 07:05:05 +0800
commit8ce504820af04194a41acbe1f4c61cf12bd5feb5 (patch)
treeb8ea43958545d28841001cf030109bdf520f970a /test
parent65a3da8b15ffb31ee3cdbc5d651cab7ee36fe884 (diff)
downloadrneovim-8ce504820af04194a41acbe1f4c61cf12bd5feb5.tar.gz
rneovim-8ce504820af04194a41acbe1f4c61cf12bd5feb5.tar.bz2
rneovim-8ce504820af04194a41acbe1f4c61cf12bd5feb5.zip
vim-patch:9.1.1167: mark '] wrong after copying text object (#32712)
Problem: mark '] wrong after copying text object (ubaldot) Solution: Adjust position of '] for non-linewise, exclusive motions (Jim Zhou) related: vim/vim#16679 closes: vim/vim#16772 https://github.com/vim/vim/commit/360a39ae6c823dd3e3c89c209b544f345c6d86dd Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_registers.vim50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/old/testdir/test_registers.vim b/test/old/testdir/test_registers.vim
index 2557f2bcbd..40cc5fe8fd 100644
--- a/test/old/testdir/test_registers.vim
+++ b/test/old/testdir/test_registers.vim
@@ -1037,4 +1037,54 @@ func Test_register_cursor_column_negative()
call StopVimInTerminal(buf)
endfunc
+" test '] mark generated by op_yank
+func Test_mark_from_yank()
+ new
+ " double quote object
+ call setline(1, 'test "yank" mark')
+ normal! yi"
+ call assert_equal([0, 1, 10, 0], getpos("']"))
+ normal! ya"
+ call assert_equal(getpos("']"), [0, 1, 13, 0], getpos("']"))
+ " single quote object
+ call setline(1, 'test ''yank'' mark')
+ normal! yi'
+ call assert_equal([0, 1, 10, 0], getpos("']"))
+ normal! ya'
+ call assert_equal([0, 1, 13, 0], getpos("']"))
+ " paren object
+ call setline(1, 'test (yank) mark')
+ call cursor(1, 9)
+ normal! yi(
+ call assert_equal([0, 1, 10, 0], getpos("']"))
+ call cursor(1, 9)
+ normal! ya(
+ call assert_equal([0, 1, 11, 0], getpos("']"))
+ " brace object
+ call setline(1, 'test {yank} mark')
+ call cursor(1, 9)
+ normal! yi{
+ call assert_equal([0, 1, 10, 0], getpos("']"))
+ call cursor(1, 9)
+ normal! ya{
+ call assert_equal([0, 1, 11, 0], getpos("']"))
+ " bracket object
+ call setline(1, 'test [yank] mark')
+ call cursor(1, 9)
+ normal! yi[
+ call assert_equal([0, 1, 10, 0], getpos("']"))
+ call cursor(1, 9)
+ normal! ya[
+ call assert_equal([0, 1, 11, 0], getpos("']"))
+ " block object
+ call setline(1, 'test <yank> mark')
+ call cursor(1, 9)
+ normal! yi<
+ call assert_equal([0, 1, 10, 0], getpos("']"))
+ call cursor(1, 9)
+ normal! ya<
+ call assert_equal([0, 1, 11, 0], getpos("']"))
+ bw!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab