summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-06 21:29:29 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-06 21:29:29 +0200
commit0acae7acc40b9f12bff88d5e1dae494a761fec07 (patch)
tree10c62e1957bdda546b3dfae7587574fbb7d61654 /src/ex_docmd.c
parentf97d46f816e84edb6899a903a1c334a50a6d31bb (diff)
patch 8.1.1822: confusing error message when range is not allowedv8.1.1822
Problem: Confusing error message when range is not allowed. Solution: With ADDR_NONE give e_norange. Change e_invaddr to e_invrange for consistency.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 74adb847b7..6df1c3189d 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -4208,6 +4208,15 @@ skip_range(
return cmd;
}
+ static void
+addr_error(cmd_addr_T addr_type)
+{
+ if (addr_type == ADDR_NONE)
+ emsg(_(e_norange));
+ else
+ emsg(_(e_invrange));
+}
+
/*
* Get a single EX address.
*
@@ -4264,10 +4273,10 @@ get_address(
case ADDR_TABS:
lnum = CURRENT_TAB_NR;
break;
- case ADDR_TABS_RELATIVE:
case ADDR_NONE:
+ case ADDR_TABS_RELATIVE:
case ADDR_UNSIGNED:
- emsg(_(e_invrange));
+ addr_error(addr_type);
cmd = NULL;
goto error;
break;
@@ -4314,10 +4323,10 @@ get_address(
case ADDR_TABS:
lnum = LAST_TAB_NR;
break;
- case ADDR_TABS_RELATIVE:
case ADDR_NONE:
+ case ADDR_TABS_RELATIVE:
case ADDR_UNSIGNED:
- emsg(_(e_invrange));
+ addr_error(addr_type);
cmd = NULL;
goto error;
break;
@@ -4346,7 +4355,7 @@ get_address(
}
if (addr_type != ADDR_LINES)
{
- emsg(_(e_invaddr));
+ addr_error(addr_type);
cmd = NULL;
goto error;
}
@@ -4378,7 +4387,7 @@ get_address(
c = *cmd++;
if (addr_type != ADDR_LINES)
{
- emsg(_(e_invaddr));
+ addr_error(addr_type);
cmd = NULL;
goto error;
}
@@ -4428,7 +4437,7 @@ get_address(
++cmd;
if (addr_type != ADDR_LINES)
{
- emsg(_(e_invaddr));
+ addr_error(addr_type);
cmd = NULL;
goto error;
}
@@ -7926,7 +7935,7 @@ ex_copymove(exarg_T *eap)
*/
if (n == MAXLNUM || n < 0 || n > curbuf->b_ml.ml_line_count)
{
- emsg(_(e_invaddr));
+ emsg(_(e_invrange));
return;
}