To: vim_dev@googlegroups.com Subject: Patch 9.0.0102 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0102 Problem: Reading past end of line with insert mode completion. Solution: Check text length. Files: src/insexpand.c, src/testdir/test_ins_complete.vim *** ../vim-9.0.0101/src/insexpand.c 2022-07-23 09:52:00.337814264 +0100 --- src/insexpand.c 2022-07-28 21:49:01.884292093 +0100 *************** *** 3501,3507 **** { char_u *tmp_ptr = ptr; ! if (compl_status_adding()) { tmp_ptr += compl_length; // Skip if already inside a word. --- 3501,3507 ---- { char_u *tmp_ptr = ptr; ! if (compl_status_adding() && compl_length <= (int)STRLEN(tmp_ptr)) { tmp_ptr += compl_length; // Skip if already inside a word. *** ../vim-9.0.0101/src/testdir/test_ins_complete.vim 2022-07-27 14:39:57.308548748 +0100 --- src/testdir/test_ins_complete.vim 2022-07-28 21:45:34.272331180 +0100 *************** *** 2142,2146 **** --- 2142,2154 ---- bwipe! endfunc + func Test_ins_complete_end_of_line() + " this was reading past the end of the line + new + norm 8o€ý  + sil! norm o + + bwipe! + endfunc " vim: shiftwidth=2 sts=2 expandtab *** ../vim-9.0.0101/src/version.c 2022-07-28 18:44:24.229873422 +0100 --- src/version.c 2022-07-28 21:47:34.212318669 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 102, /**/ -- Rule #1: Don't give somebody a tool that he's going to hurt himself with. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///