aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_normal.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-08 18:58:06 +0800
committerGitHub <noreply@github.com>2022-12-08 18:58:06 +0800
commit4f64aef29f24b5ac305b609d0abf78d93e2c5e0d (patch)
tree6bb62039af4d839abe6c13e2a0f5cc75dbae3309 /src/nvim/testdir/test_normal.vim
parenta27ed57ad040a7dfb67deba026df684fc375d509 (diff)
downloadrneovim-4f64aef29f24b5ac305b609d0abf78d93e2c5e0d.tar.gz
rneovim-4f64aef29f24b5ac305b609d0abf78d93e2c5e0d.tar.bz2
rneovim-4f64aef29f24b5ac305b609d0abf78d93e2c5e0d.zip
vim-patch:8.2.3564: invalid memory access when scrolling without valid screen (#21335)
vim-patch:8.2.3564: invalid memory access when scrolling without valid screen Problem: Invalid memory access when scrolling without a valid screen. Solution: Do not set VALID_BOTLINE in w_valid. https://github.com/vim/vim/commit/777e7c21b7627be80961848ac560cb0a9978ff43 Remove -Z flag when using RunVim(). Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir/test_normal.vim')
-rw-r--r--src/nvim/testdir/test_normal.vim22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim
index c2ad49f0c9..7c90b444e5 100644
--- a/src/nvim/testdir/test_normal.vim
+++ b/src/nvim/testdir/test_normal.vim
@@ -36,14 +36,14 @@ func CountSpaces(type, ...)
else
silent exe "normal! `[v`]y"
endif
- let g:a=strlen(substitute(@@, '[^ ]', '', 'g'))
+ let g:a = strlen(substitute(@@, '[^ ]', '', 'g'))
let &selection = sel_save
let @@ = reg_save
endfunc
func OpfuncDummy(type, ...)
" for testing operatorfunc
- let g:opt=&linebreak
+ let g:opt = &linebreak
if a:0 " Invoked from Visual mode, use gv command.
silent exe "normal! gvy"
@@ -54,7 +54,7 @@ func OpfuncDummy(type, ...)
endif
" Create a new dummy window
new
- let g:bufnr=bufnr('%')
+ let g:bufnr = bufnr('%')
endfunc
func Test_normal00_optrans()
@@ -1286,6 +1286,22 @@ func Test_vert_scroll_cmds()
close!
endfunc
+func Test_scroll_in_ex_mode()
+ " This was using invalid memory because w_botline was invalid.
+ let lines =<< trim END
+ diffsplit
+ norm os00(
+ call writefile(['done'], 'Xdone')
+ qa!
+ END
+ call writefile(lines, 'Xscript')
+ 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
+
" Test for the 'sidescroll' option
func Test_sidescroll_opt()
new