diff src/evalfunc.c @ 13101:9b3f8029a326 v8.0.1425

patch 8.0.1425: execute() does not work in completion of user command commit https://github.com/vim/vim/commit/2095148277cf1c4e7b3bbaf4e34812b7cfe3011b Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 25 13:44:43 2017 +0100 patch 8.0.1425: execute() does not work in completion of user command Problem: execute() does not work in completion of user command. (thinca) Solution: Switch off redir_off and restore it. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/2492)
author Christian Brabandt <cb@256bit.org>
date Mon, 25 Dec 2017 13:45:05 +0100
parents 3dd37eec73f0
children aaead5b4d77d
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -2886,6 +2886,7 @@ f_execute(typval_T *argvars, typval_T *r
     int		save_emsg_silent = emsg_silent;
     int		save_emsg_noredir = emsg_noredir;
     int		save_redir_execute = redir_execute;
+    int		save_redir_off = redir_off;
     garray_T	save_ga;
 
     rettv->vval.v_string = NULL;
@@ -2928,6 +2929,7 @@ f_execute(typval_T *argvars, typval_T *r
 	save_ga = redir_execute_ga;
     ga_init2(&redir_execute_ga, (int)sizeof(char), 500);
     redir_execute = TRUE;
+    redir_off = FALSE;
 
     if (cmd != NULL)
 	do_cmdline_cmd(cmd);
@@ -2958,6 +2960,7 @@ f_execute(typval_T *argvars, typval_T *r
     redir_execute = save_redir_execute;
     if (redir_execute)
 	redir_execute_ga = save_ga;
+    redir_off = save_redir_off;
 
     /* "silent reg" or "silent echo x" leaves msg_col somewhere in the
      * line.  Put it back in the first column. */