patch 8.2.2532: Vim9: confusing error if :k is used with a range
Problem: Vim9: confusing error if :k is used with a range.
Solution: Give an error about the range. (issue #7874)
diff --git a/src/vim9script.c b/src/vim9script.c
index 751d8fb..0994e51 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -92,10 +92,16 @@
if (in_vim9script())
switch (eap->cmdidx)
{
+ case CMD_k:
+ if (eap->addr_count > 0)
+ {
+ emsg(_(e_norange));
+ return FAIL;
+ }
+ // FALLTHROUGH
case CMD_append:
case CMD_change:
case CMD_insert:
- case CMD_k:
case CMD_t:
case CMD_xit:
semsg(_(e_command_not_supported_in_vim9_script_missing_var_str), eap->cmd);