Patch 8.0.1425
Problem: execute() does not work in completion of user command. (thinca)
Solution: Switch off redir_off and restore it. (Ozaki Kiichi, closes #2492)
Files: src/evalfunc.c, src/testdir/test_usercommands.vim
*** ../vim-8.0.1424/src/evalfunc.c 2017-12-21 20:27:40.768178638 +0100
--- src/evalfunc.c 2017-12-25 13:39:26.045929809 +0100
***************
*** 2886,2891 ****
--- 2886,2892 ----
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,2933 ****
--- 2929,2935 ----
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,2963 ****
--- 2960,2966 ----
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. */
*** ../vim-8.0.1424/src/testdir/test_usercommands.vim 2017-10-15
22:07:35.211683156 +0200
--- src/testdir/test_usercommands.vim 2017-12-25 13:39:26.045929809 +0100
***************
*** 206,208 ****
--- 206,220 ----
com! -complete=customlist,CustomComp DoCmd :
call assert_fails("call feedkeys(':DoCmd \<C-D>', 'tx')", 'E117:')
endfunc
+
+ func CallExecute(A, L, P)
+ " Drop first '\n'
+ return execute('echo "hi"')[1:]
+ endfunc
+
+ func Test_use_execute_in_completion()
+ command! -nargs=* -complete=custom,CallExecute DoExec :
+ call feedkeys(":DoExec \<C-A>\<C-B>\"\<CR>", 'tx')
+ call assert_equal('"DoExec hi', @:)
+ delcommand DoExec
+ endfunc
*** ../vim-8.0.1424/src/version.c 2017-12-23 18:41:31.137791160 +0100
--- src/version.c 2017-12-25 13:40:35.557612237 +0100
***************
*** 773,774 ****
--- 773,776 ----
{ /* Add new patch number below this line */
+ /**/
+ 1425,
/**/
--
hundred-and-one symptoms of being an internet addict:
159. You get excited whenever discussing your hard drive.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.