aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-06-10 08:41:48 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-06-10 21:28:30 -0400
commitd662dfde363b80ce8fc446ab7d8299cbd626f074 (patch)
tree3a102241bf787e8257a691afcb78f5b22e3eca37 /src/nvim/testdir
parentcb368e1bffe110a8b73b3c13e3780f2d587bbde2 (diff)
downloadrneovim-d662dfde363b80ce8fc446ab7d8299cbd626f074.tar.gz
rneovim-d662dfde363b80ce8fc446ab7d8299cbd626f074.tar.bz2
rneovim-d662dfde363b80ce8fc446ab7d8299cbd626f074.zip
vim-patch:8.2.2422: crash when deleting with line number out of range
Problem: Crash when deleting with line number out of range. (Houyunsong) Solution: Avoid using a negative line number. https://github.com/vim/vim/commit/1d859e24218635c57c09801840ff159cb845ae6a
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_ex_mode.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_ex_mode.vim b/src/nvim/testdir/test_ex_mode.vim
index f70cb261e0..1c645ad0f8 100644
--- a/src/nvim/testdir/test_ex_mode.vim
+++ b/src/nvim/testdir/test_ex_mode.vim
@@ -1,5 +1,8 @@
" Test editing line in Ex mode (see :help Q and :help gQ).
+source check.vim
+source shared.vim
+
" Helper function to test editing line in Q Ex mode
func Ex_Q(cmd)
" Is there a simpler way to test editing Ex line?
@@ -79,4 +82,20 @@ func Test_ex_mode_errors()
quit
endfunc
+func Test_ex_mode_count_overflow()
+ " this used to cause a crash
+ let lines =<< trim END
+ call feedkeys("\<Esc>Q\<CR>")
+ v9|9silent! vi|333333233333y32333333%O
+ call writefile(['done'], 'Xdidexmode')
+ qall!
+ END
+ call writefile(lines, 'Xexmodescript')
+ call assert_equal(1, RunVim([], [], '-e -s -S Xexmodescript -c qa'))
+ call assert_equal(['done'], readfile('Xdidexmode'))
+
+ call delete('Xdidexmode')
+ call delete('Xexmodescript')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab