mirror of
https://github.com/neovim/neovim.git
synced 2025-11-17 15:51:32 +00:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user