aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/messages_spec.lua
diff options
context:
space:
mode:
authornwounkn <nwounkn@gmail.com>2023-10-13 12:01:26 +0500
committerzeertzjq <zeertzjq@outlook.com>2023-10-14 14:23:08 +0800
commit13f55750e9bea8ec8f50550546edc64a0f0964d8 (patch)
tree741aa03b9f0d2edc53c210f5b9bebba251c8d9fb /test/functional/ui/messages_spec.lua
parentce0f80835a5f6febd64f4ce5cf245d476ebaecfd (diff)
downloadrneovim-13f55750e9bea8ec8f50550546edc64a0f0964d8.tar.gz
rneovim-13f55750e9bea8ec8f50550546edc64a0f0964d8.tar.bz2
rneovim-13f55750e9bea8ec8f50550546edc64a0f0964d8.zip
fix(ui): empty line before the next message after :silent command
Problem: The next command after `silent !{cmd}` or `silent lua print('str')` prints an empty line before printing a message, because these commands set `msg_didout = true` despite not printing any messages. Solution: Set `msg_didout = true` only if `msg_silent == 0`
Diffstat (limited to 'test/functional/ui/messages_spec.lua')
-rw-r--r--test/functional/ui/messages_spec.lua47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index ca2bf67220..a5b2474bc5 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1061,6 +1061,53 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
-- luacheck: pop
end)
+ it('no empty line after :silent #12099', function()
+ exec([[
+ func T1()
+ silent !echo
+ echo "message T1"
+ endfunc
+ func T2()
+ silent lua print("lua message")
+ echo "message T2"
+ endfunc
+ func T3()
+ silent call nvim_out_write("api message\n")
+ echo "message T3"
+ endfunc
+ ]])
+ feed(':call T1()<CR>')
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ message T1 |
+ ]]}
+ feed(':call T2()<CR>')
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ message T2 |
+ ]]}
+ feed(':call T3()<CR>')
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ message T3 |
+ ]]}
+ end)
+
it('supports ruler with laststatus=0', function()
command("set ruler laststatus=0")
screen:expect{grid=[[