From d92cc130fbb1beacf6411ee5837545f46f9be90e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 18 Nov 2020 17:17:15 +0100 Subject: patch 8.2.2012: Vim9: confusing error message when using bool wrongly Problem: Vim9: confusing error message when using bool wrongly. Solution: Mention "Bool" instead of "Special". (closes #7323) --- src/typval.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/typval.c') 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; -- cgit v1.2.1