fix(ui): check for cmdline mode properly

Backport of #35202
This commit is contained in:
zeertzjq
2025-08-07 12:22:01 +08:00
parent 7f1e112a32
commit 6fd842a4fd
7 changed files with 28 additions and 9 deletions

View File

@@ -1141,6 +1141,16 @@ describe('cmdline redraw', function()
]])
command('redraw')
screen:expect_unchanged()
command('set keymap=dvorak')
feed('<C-^>')
command('redraw')
screen:expect_unchanged()
feed('<C-^>')
command('set keymap&')
command('redraw')
screen:expect_unchanged()
end)
it('substitute confirm prompt does not scroll', function()

View File

@@ -9587,6 +9587,15 @@ describe('float window', function()
]]
})
end
command('set keymap=dvorak')
feed('<C-^>')
screen:expect_unchanged()
feed('<C-^>')
command('set keymap&')
screen:expect_unchanged()
feed('<ESC>')
-- Show cursor after switching to a normal window (hide=false).

View File

@@ -365,7 +365,7 @@ for _, v in ipairs(ext_keys) do
expect_keys[v] = true
end
--- @class test.function.ui.screen.Expect
--- @class test.functional.ui.screen.Expect
---
--- Expected screen state (string). Each line represents a screen
--- row. Last character of each row (typically "|") is stripped.
@@ -460,7 +460,7 @@ end
--- or keyword args (supports more options):
--- screen:expect({ grid=[[...]], cmdline={...}, condition=function() ... end })
---
--- @param expected string|function|test.function.ui.screen.Expect
--- @param expected string|function|test.functional.ui.screen.Expect
--- @param attr_ids? table<integer,table<string,any>>
function Screen:expect(expected, attr_ids, ...)
--- @type string, fun()