aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2018-12-05 19:14:19 -0500
committerJustin M. Keyes <justinkz@gmail.com>2018-12-06 01:14:19 +0100
commit769762834533292e1d6a34b3846213d3896dc386 (patch)
tree5d96fed6cf87682b7767156138f8d0f8929dd15a /src/nvim/testdir
parent77b5e9ae25fc79cd647ed6a0535b234bcc82180d (diff)
downloadrneovim-769762834533292e1d6a34b3846213d3896dc386.tar.gz
rneovim-769762834533292e1d6a34b3846213d3896dc386.tar.bz2
rneovim-769762834533292e1d6a34b3846213d3896dc386.zip
vim-patch:8.0.1425: execute() does not work in completion of user command (#9317)
Problem: execute() does not work in completion of user command. (thinca) Solution: Switch off redir_off and restore it. (Ozaki Kiichi, closes vim/vim#2492) https://github.com/vim/vim/commit/2095148277cf1c4e7b3bbaf4e34812b7cfe3011b
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_usercommands.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_usercommands.vim b/src/nvim/testdir/test_usercommands.vim
index db603610da..1520c2f32a 100644
--- a/src/nvim/testdir/test_usercommands.vim
+++ b/src/nvim/testdir/test_usercommands.vim
@@ -206,3 +206,15 @@ func Test_CmdCompletion()
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