vim-patch:9.0.0101: invalid memory access in diff mode with "dp" and undo (#19568)

Problem:    Invalid memory access in diff mode with "dp" and undo.
Solution:   Make sure the line number does not go below one.
4e677b9c40
This commit is contained in:
zeertzjq
2022-07-29 07:31:54 +08:00
committed by GitHub
parent 352a177dae
commit 88ed33230a
2 changed files with 23 additions and 5 deletions

View File

@@ -1471,5 +1471,19 @@ func Test_diff_manipulations()
doobdeu
set nodiff
%bwipe!
endfunc
" This was causing the line number in the diff block to go below one.
" FIXME: somehow this causes a valgrind error when run directly but not when
" run as a test.
func Test_diff_put_and_undo()
set diff
next 0
split 00
sil! norm o0gguudpo0ggJuudp
bwipe!
bwipe!
set nodiff
endfunc