fix(ui): avoid redundant ext_cmdline events (#32237)

Problem:  `cmdline_show` is emitted unnecessarily each event
          loop iteration, because `cmdline_was_last_drawn` is never set.
Solution: Keep track of whether the cmdline was last drawn to avoid
          unnecessarily emitting cmdline_show. Set `redraw_state` to
          emit `cmdline_pos` when emitting `CursorMovedC`. Only emit
          `cmdline_pos` when cmdline was last drawn.
This commit is contained in:
luukvbaal
2025-01-29 12:07:27 +01:00
committed by GitHub
parent e7ebc5c13d
commit 216ec73972
3 changed files with 35 additions and 30 deletions

View File

@@ -202,7 +202,7 @@ describe('vim.ui_attach', function()
feed([[:call confirm("Save changes?", "&Yes\n&No\n&Cancel")<CR>]])
screen:expect({
grid = [[
^5 |
^4 |
{1:~ }|*4
]],
cmdline = {
@@ -224,7 +224,7 @@ describe('vim.ui_attach', function()
feed('n')
screen:expect({
grid = [[
^5 |
^4 |
{1:~ }|*4
]],
cmdline = { { abort = false } },