patch 9.0.1332: crash when using buffer-local user command in cmdline window
Problem: Crash when using buffer-local user command in cmdline window.
(Karl Yngve LervÄg)
Solution: Use the right buffer to find the user command. (closes #12030,
closes #12029)
diff --git a/src/usercmd.c b/src/usercmd.c
index 44fa578..7d84462 100644
--- a/src/usercmd.c
+++ b/src/usercmd.c
@@ -1838,7 +1838,7 @@
if (eap->cmdidx == CMD_USER)
cmd = USER_CMD(eap->useridx);
else
- cmd = USER_CMD_GA(&curbuf->b_ucmds, eap->useridx);
+ cmd = USER_CMD_GA(&prevwin_curwin()->w_buffer->b_ucmds, eap->useridx);
/*
* Replace <> in the command by the arguments.