fix(ui2): show messages in dialog window when entering expanded cmdline #38465

Problem:  - With expanded messages exceeding cfg.msg.cmd.height, entering
            the cmdline scrolls to the bottom and expands to the full "cmd"
            buffer text height.

          - Cursor in the pager is not always at the last message and at
            the bottom of the window when appending to the pager.

          - unreliable test: messages2_spec: "closed msg window timer removes
            empty lines".
Solution: - Achieve separation of the cmdline and message text by moving
            messages to the dialog window when entering the cmdline below
            expanded messages.

          - Set cursor to start of the first message only when first
            entering the pager. Use `norm! zb` to position last message
            at the bottom of the window (which shouldn't crash anymore
            since 911337eb).

          - Increase cfg.msg.msg.timeout used in the test file.
This commit is contained in:
luukvbaal
2026-03-24 14:53:25 +01:00
committed by GitHub
parent 042c66e4f9
commit b2adfe775d
3 changed files with 23 additions and 21 deletions

View File

@@ -6,7 +6,7 @@ local Screen = require('test.functional.ui.screen')
local api, clear, command, exec_lua, feed = n.api, n.clear, n.command, n.exec_lua, n.feed
local msg_timeout = 200
local msg_timeout = 400
local function set_msg_target_zero_ch()
exec_lua(function()
require('vim._core.ui2').enable({ msg = { target = 'msg', msg = { timeout = msg_timeout } } })
@@ -447,9 +447,9 @@ describe('messages2', function()
foo |
{1:~ }|*8
{3: }|
^foo |
foo |
bar |
baz |
^baz |
{16::}{15:echo} {26:"baz"} |
]])
-- Subsequent typed commands are appended to the pager.