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\<C-O>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\<C-O>lx"
! call assert_equal("\<C-O>def", getline(1))
!
! call setline(1, 'abcdef')
! exe "normal! 0gr\<C-G>lx"
! call assert_equal("\<C-G>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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20230225142525.5D8681C0B1F%40moolenaar.net.