From 771564b00e5b64ac74be443dde84e160bc7fce05 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 25 Jul 2022 20:09:23 +0800 Subject: vim-patch:8.2.5164: invalid memory access after diff buffer manipulations Problem: Invalid memory access after diff buffer manipulations. Solution: Use zero offset when change removes all lines in a diff block. https://github.com/vim/vim/commit/c101abff4c6756db4f5e740fde289decb9452efa --- src/nvim/testdir/test_diffmode.vim | 12 ++++++++++++ 1 file changed, 12 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 7ab8d0347b..3eabad28d0 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -1458,5 +1458,17 @@ func Test_diff_only() %bwipe! endfunc +" This was causing invalid diff block values +" FIXME: somehow this causes a valgrind error when run directly but not when +" run as a test. +func Test_diff_manipulations() + set diff + split 0 + sil! norm R doobdeuR doobdeuR doobdeu + + set nodiff + %bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit