summaryrefslogtreecommitdiffstats
path: root/src/evalfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-04-12 12:54:11 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-12 12:54:11 +0100
commit575445200bd35283191ecd7a0d596b37c5b477a4 (patch)
tree2188e3f108e7337222c859bc3ca2ab51227cd61b /src/evalfunc.c
parentd58862d18f091d3c14fa3647e724ef7eea1ecefa (diff)
patch 8.2.4740: when expand() fails there is no error messagev8.2.4740
Problem: When expand() fails there is no error message. Solution: When 'verbose' is set give an error message.
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index e56b505d2b..e30186b034 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4065,7 +4065,6 @@ f_expand(typval_T *argvars, typval_T *rettv)
{
char_u *s;
int len;
- char *errormsg;
int options = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND;
expand_T xpc;
int error = FALSE;
@@ -4096,9 +4095,15 @@ f_expand(typval_T *argvars, typval_T *rettv)
s = tv_get_string(&argvars[0]);
if (*s == '%' || *s == '#' || *s == '<')
{
- ++emsg_off;
+ char *errormsg = NULL;
+
+ if (p_verbose == 0)
+ ++emsg_off;
result = eval_vars(s, s, &len, NULL, &errormsg, NULL);
- --emsg_off;
+ if (p_verbose == 0)
+ --emsg_off;
+ else if (errormsg != NULL)
+ emsg(errormsg);
if (rettv->v_type == VAR_LIST)
{
if (rettv_list_alloc(rettv) != FAIL && result != NULL)