To: vim_dev@googlegroups.com Subject: Patch 9.0.1354 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1354 Problem: "gr CTRL-G" stays in virtual replace mode. (Pierre Ganty) Solution: Prepend CTRL-V before control characters. (closes #12045) Files: src/edit.c, src/normal.c, src/testdir/test_edit.vim *** ../vim-9.0.1353/src/edit.c 2023-02-23 22:14:33.618127614 +0000 --- src/edit.c 2023-02-25 13:07:31.939302060 +0000 *************** *** 3527,3532 **** --- 3527,3536 ---- dont_sync_undo = MAYBE; break; + case ESC: + // Esc after CTRL-G cancels it. + break; + // Unknown CTRL-G command, reserved for future expansion. default: vim_beep(BO_CTRLG); } *** ../vim-9.0.1353/src/normal.c 2023-02-21 14:27:34.520360383 +0000 --- src/normal.c 2023-02-25 13:13:41.204154491 +0000 *************** *** 5033,5038 **** --- 5033,5042 ---- { if (cap->extra_char == Ctrl_V) // get another character cap->extra_char = get_literal(FALSE); + if (cap->extra_char < ' ') + // Prefix a control character with CTRL-V to avoid it being used as + // a command. + stuffcharReadbuff(Ctrl_V); stuffcharReadbuff(cap->extra_char); stuffcharReadbuff(ESC); if (virtual_active()) *** ../vim-9.0.1353/src/testdir/test_edit.vim 2023-02-23 20:12:59.222636019 +0000 --- src/testdir/test_edit.vim 2023-02-25 14:23:22.134034520 +0000 *************** *** 2068,2075 **** func Test_edit_gr_special() enew call setline(1, ['abcdef', 'xxxxxx']) ! exe "normal! gr\x" ! call assert_equal('bcdef', getline(1)) bwipe! endfunc --- 2068,2079 ---- func Test_edit_gr_special() enew call setline(1, ['abcdef', 'xxxxxx']) ! exe "normal! gr\lx" ! call assert_equal("\def", getline(1)) ! ! call setline(1, 'abcdef') ! exe "normal! 0gr\lx" ! call assert_equal("\def", getline(1)) bwipe! endfunc *** ../vim-9.0.1353/src/version.c 2023-02-25 11:59:28.870874069 +0000 --- src/version.c 2023-02-25 13:12:00.363956494 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1354, /**/ -- hundred-and-one symptoms of being an internet addict: 176. You lie, even to user-friends, about how long you were online yesterday. /// 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 ///