summaryrefslogtreecommitdiff
path: root/src/typval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-11-18 17:17:15 +0100
committerBram Moolenaar <Bram@vim.org>2020-11-18 17:17:15 +0100
commitd92cc130fbb1beacf6411ee5837545f46f9be90e (patch)
treed6b79e63ce4845c810b33434c3de75f9c332af55 /src/typval.c
parent9950280d377a5c0706d141017fcef9cad598b8b0 (diff)
downloadvim-git-d92cc130fbb1beacf6411ee5837545f46f9be90e.tar.gz
patch 8.2.2012: Vim9: confusing error message when using bool wronglyv8.2.2012
Problem: Vim9: confusing error message when using bool wrongly. Solution: Mention "Bool" instead of "Special". (closes #7323)
Diffstat (limited to 'src/typval.c')
-rw-r--r--src/typval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/typval.c b/src/typval.c
index 7c55d3a5e..0e2513aee 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -213,7 +213,10 @@ tv_get_bool_or_number_chk(typval_T *varp, int *denote, int want_bool)
case VAR_SPECIAL:
if (!want_bool && in_vim9script())
{
- emsg(_("E611: Using a Special as a Number"));
+ if (varp->v_type == VAR_BOOL)
+ emsg(_(e_using_bool_as_number));
+ else
+ emsg(_("E611: Using a Special as a Number"));
break;
}
return varp->vval.v_number == VVAL_TRUE ? 1 : 0;