diff --git a/runtime/lua/vim/_core/ui2/messages.lua b/runtime/lua/vim/_core/ui2/messages.lua index bf582bd7f05..1038c70c8ea 100644 --- a/runtime/lua/vim/_core/ui2/messages.lua +++ b/runtime/lua/vim/_core/ui2/messages.lua @@ -672,7 +672,7 @@ local function win_row_height_border(tgt, min) if tgt ~= 'pager' then return (tgt == 'msg' and 0 or 1) - ui.cmd.wmnumode, math.max(1, min), - min < o.lines - ui.cmdheight + min < o.lines - ui.cmdheight and ui.cmdheight > 0 end local cmdwin_win = require('vim._core.cmdwin').win() local cmdwin = cmdwin_win and api.nvim_win_get_height(cmdwin_win) or 0 diff --git a/test/functional/ui/messages2_spec.lua b/test/functional/ui/messages2_spec.lua index 6df427625c0..767063f008f 100644 --- a/test/functional/ui/messages2_spec.lua +++ b/test/functional/ui/messages2_spec.lua @@ -401,14 +401,25 @@ describe('messages2', function() feed([[echo "bar\n"->repeat(&lines)]]) screen:expect([[ ^ | - {1:~ }|*4 - {3: }| + {1:~ }|*5 foo | bar |*5 bar [+8] | ]]) end) + it('does not draw the message seperator with cmdheight=0', function() + command('set laststatus=2 statusline=%f') + command('set cmdheight=0') + command('echo "hello"') + + screen:expect([[ + ^ | + {1:~ }|*12 + hello | + ]]) + end) + it('no prompt and newlines with Visual filter command #38273', function() set_msg_target_zero_ch() feed('V:w !printf foo') @@ -987,8 +998,7 @@ describe('messages2', function() command('ls!') screen:expect([[ ^ | - {1:~ }| - {3: }| + {1:~ }|*2 foo |*2 {14:f}oo [+6] | ]])