From 50672e3850ddd0ddacfcdcd536922440fb719093 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 2 Aug 2022 05:55:07 +0800 Subject: vim-patch:8.2.5013: after text formatting cursor may be in an invalid position Problem: After text formatting the cursor may be in an invalid position. Solution: Correct the cursor position after formatting. https://github.com/vim/vim/commit/78d52883e10d71f23ab72a3d8b9733b00da8c9ad --- src/nvim/testdir/test_textformat.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_textformat.vim b/src/nvim/testdir/test_textformat.vim index 1d1f20d91a..0fc56083aa 100644 --- a/src/nvim/testdir/test_textformat.vim +++ b/src/nvim/testdir/test_textformat.vim @@ -1534,4 +1534,16 @@ func Test_autoformat_comments() close! endfunc +" This was leaving the cursor after the end of a line. Complicated way to +" have the problem show up with valgrind. +func Test_correct_cursor_position() + " set encoding=iso8859 + new + norm a000“0 + sil! norm gggg0i0gw0gg + + bwipe! + set encoding=utf8 +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit