patch 8.2.1000: get error when leaving Ex mode with :visual
Problem: Get error when leaving Ex mode with :visual and a CmdLineEnter
autocommand was used.
Solution: Reset ex_pressedreturn. (closes #6293)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 3a1a614..93f33ae 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1895,7 +1895,7 @@
p = ea.cmd;
while (ASCII_ISALNUM(*p))
++p;
- p = vim_strnsave(ea.cmd, (int)(p - ea.cmd));
+ p = vim_strnsave(ea.cmd, p - ea.cmd);
ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL);
vim_free(p);
// If the autocommands did something and didn't cause an error, try
@@ -6215,6 +6215,7 @@
|| eap->cmdidx == CMD_view))
{
exmode_active = FALSE;
+ ex_pressedreturn = FALSE;
if (*eap->arg == NUL)
{
// Special case: ":global/pat/visual\NLvi-commands"