aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-01-23 08:12:10 +0800
committerGitHub <noreply@github.com>2025-01-23 08:12:10 +0800
commita9c12d4c298813ed3aee36b2b4d5d0912c7201ea (patch)
tree3efd52839a53b826d2559125cd3f1ed86d738391 /test
parentfd55c7df6f7eb61c65e93c6dd8beffaeed93d2ed (diff)
downloadrneovim-a9c12d4c298813ed3aee36b2b4d5d0912c7201ea.tar.gz
rneovim-a9c12d4c298813ed3aee36b2b4d5d0912c7201ea.tar.bz2
rneovim-a9c12d4c298813ed3aee36b2b4d5d0912c7201ea.zip
vim-patch:9.1.1048: crash after scrolling and pasting in silent Ex mode (#32168)
Problem: Crash after scrolling and pasting in silent Ex mode. (fizz-is-on-the-way) Solution: Don't move cursor to line 0 when scrolling. (zeertzjq) closes: vim/vim#16506 https://github.com/vim/vim/commit/df098fedbc2c481e91ea7e6207dab90359a92cc3
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_normal.vim21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/old/testdir/test_normal.vim b/test/old/testdir/test_normal.vim
index c89e73bada..1d9609cbe1 100644
--- a/test/old/testdir/test_normal.vim
+++ b/test/old/testdir/test_normal.vim
@@ -1338,11 +1338,27 @@ func Test_scroll_in_ex_mode()
call writefile(['done'], 'Xdone')
qa!
END
- call writefile(lines, 'Xscript')
+ call writefile(lines, 'Xscript', 'D')
call assert_equal(1, RunVim([], [], '--clean -X -Z -e -s -S Xscript'))
call assert_equal(['done'], readfile('Xdone'))
- call delete('Xscript')
+ call delete('Xdone')
+endfunc
+
+func Test_scroll_and_paste_in_ex_mode()
+ throw 'Skipped: does not work when Nvim is run from :!'
+ " This used to crash because of moving cursor to line 0.
+ let lines =<< trim END
+ v/foo/vi|YY9PYQ
+ v/bar/vi|YY9PYQ
+ v/bar/exe line('.') == 1 ? "vi|Y\<C-B>9PYQ" : "vi|YQ"
+ call writefile(['done'], 'Xdone')
+ qa!
+ END
+ call writefile(lines, 'Xscript', 'D')
+ call assert_equal(1, RunVim([], [], '-u NONE -i NONE -n -X -Z -e -s -S Xscript'))
+ call assert_equal(['done'], readfile('Xdone'))
+
call delete('Xdone')
endfunc
@@ -4303,4 +4319,5 @@ func Test_normal_go()
bwipe!
endfunc
+
" vim: shiftwidth=2 sts=2 expandtab nofoldenable