aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorShadman <shadmansaleh3@gmail.com>2021-04-21 14:41:37 +0600
committerGitHub <noreply@github.com>2021-04-21 10:41:37 +0200
commit01493e7990998f78298bd914a26aa65c237a3692 (patch)
treeeb44918963f0b7b174b2a0a00a621419590b0d5e /test/functional/api/vim_spec.lua
parentd7f9e58e40bd9f2449adf81788a4fab97859d5cc (diff)
downloadrneovim-01493e7990998f78298bd914a26aa65c237a3692.tar.gz
rneovim-01493e7990998f78298bd914a26aa65c237a3692.tar.bz2
rneovim-01493e7990998f78298bd914a26aa65c237a3692.zip
api: fix nvim_exec() silencing behaviour (#14413)
Previously nvim_exec would silent output no matter whether output is true or false. Now output is only silent and captured when output is true.
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 3db44f3f11..6926022ee3 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -193,6 +193,44 @@ describe('API', function()
eq('', nvim('exec', 'echo', true))
eq('foo 42', nvim('exec', 'echo "foo" 42', true))
end)
+
+ it('displays messages when output=false', function()
+ local screen = Screen.new(40, 8)
+ screen:attach()
+ screen:set_default_attr_ids({
+ [0] = {bold=true, foreground=Screen.colors.Blue},
+ })
+ meths.exec("echo 'hello'", false)
+ screen:expect{grid=[[
+ ^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ hello |
+ ]]}
+ end)
+
+ it('does\'t display messages when output=true', function()
+ local screen = Screen.new(40, 8)
+ screen:attach()
+ screen:set_default_attr_ids({
+ [0] = {bold=true, foreground=Screen.colors.Blue},
+ })
+ meths.exec("echo 'hello'", true)
+ screen:expect{grid=[[
+ ^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]]}
+ end)
end)
describe('nvim_command', function()