feat(ui): allow non-zero 'cmdheight' with ext_messages

Problem:  Arbitrary restriction on 'cmdheight' with ext_messages.
          The 'cmdheight'-area may be desirable for the replacing
          cmdline.
Solution: Allow non-zero 'cmdheight' with ext_messages.
This commit is contained in:
Luuk van Baal 2024-03-11 07:13:48 +01:00
parent 3814750d37
commit b72931e704
2 changed files with 6 additions and 7 deletions

View File

@ -2024,9 +2024,6 @@ static const char *did_set_cmdheight(optset_T *args)
{ {
OptInt old_value = args->os_oldval.number; OptInt old_value = args->os_oldval.number;
if (ui_has(kUIMessages)) {
p_ch = 0;
}
if (p_ch > Rows - min_rows() + 1) { if (p_ch > Rows - min_rows() + 1) {
p_ch = Rows - min_rows() + 1; p_ch = Rows - min_rows() + 1;
} }

View File

@ -844,7 +844,7 @@ describe('ui/ext_messages', function()
} }
end) end)
it('implies ext_cmdline and ignores cmdheight', function() it("implies ext_cmdline but allows changing 'cmdheight'", function()
eq(0, eval('&cmdheight')) eq(0, eval('&cmdheight'))
feed(':set cmdheight=1') feed(':set cmdheight=1')
screen:expect { screen:expect {
@ -864,15 +864,17 @@ describe('ui/ext_messages', function()
feed('<cr>') feed('<cr>')
screen:expect([[ screen:expect([[
^ | ^ |
{1:~ }|*4 {1:~ }|*3
|
]]) ]])
eq(0, eval('&cmdheight')) eq(1, eval('&cmdheight'))
feed(':set cmdheight=0') feed(':set cmdheight=0')
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
{1:~ }|*4 {1:~ }|*3
|
]], ]],
cmdline = { cmdline = {
{ {