patch 9.0.1354: "gr CTRL-G" stays in virtual replace mode
Problem: "gr CTRL-G" stays in virtual replace mode. (Pierre Ganty)
Solution: Prepend CTRL-V before control characters. (closes #12045)
diff --git a/src/normal.c b/src/normal.c
index b3ea5e8..95bb1a9 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -5033,6 +5033,10 @@
{
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())