From 88ed33230ac91423f6e09c3f7c07cc02b2b115ac Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 29 Jul 2022 07:31:54 +0800 Subject: 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. https://github.com/vim/vim/commit/4e677b9c40ccbc5f090971b31dc2fe07bf05541d --- src/nvim/testdir/test_diffmode.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/nvim/testdir/test_diffmode.vim') diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index bc931b1e1b..1dbbe578c5 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -1471,5 +1471,19 @@ func Test_diff_manipulations() %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 + " vim: shiftwidth=2 sts=2 expandtab -- cgit