From c366a63e4cdd97fc2818be348186a18e1b6eb8df Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 24 Aug 2022 21:08:17 +0800 Subject: vim-patch:9.0.0045: reading past end of completion with a long line Problem: Reading past end of completion with a long line and 'infercase' set. Solution: Allocate the string if needed. https://github.com/vim/vim/commit/caea66442d86e7bbba3bf3dc202c3c0d549b9853 Cherry-pick the deletion of a blank line from patch 9.0.0027. N/A patches for version.c: vim-patch:9.0.0054: compiler warning for size_t to int conversion Problem: Compiler warning for size_t to int conversion. Solution: Add type cast. (Mike Williams, closes vim/vim#10741) https://github.com/vim/vim/commit/c7bd2f08e531f08723cdc677212a3633d11c9a97 --- src/nvim/testdir/test_ins_complete.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim index 54d3844100..6c59041451 100644 --- a/src/nvim/testdir/test_ins_complete.vim +++ b/src/nvim/testdir/test_ins_complete.vim @@ -954,5 +954,20 @@ func Test_complete_overrun() bwipe! endfunc +func Test_infercase_very_long_line() + " this was truncating the line when inferring case + new + let longLine = "blah "->repeat(300) + let verylongLine = "blah "->repeat(400) + call setline(1, verylongLine) + call setline(2, longLine) + set ic infercase + exe "normal 2Go\\\" + call assert_equal(longLine, getline(3)) + + bwipe! + set noic noinfercase +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit