mirror of
https://github.com/neovim/neovim.git
synced 2026-09-03 21:00:34 +00:00
feat(multicursor): MC HAMMER #41587
Other (squashed) commits:
fix(tui): emit ui_send output atomically with the frame
Problem:
tui_ui_send() writes directly to the TTY, bypassing the output buffer.
Sequences sent via nvim_ui_send() (e.g. kitty multiple-cursors, or
visual-dot-repeat) always arrive in a separate TTY write from the frame
they were computed for. This manifests as "tearing", or e.g. in the case
of multicursor the terminal renders text with stale cursor overlays.
Solution:
- tui_ui_send(): while a frame is being assembled (pending invalid
regions or buffered output), buffer instead of writing directly.
- Out-of-frame sends (tty queries, clear-on-disable) still write
immediately.
- mcursor.lua: emit the terminal-cursor update at the end of the redraw
cycle (`on_end`, when screen positions are final) instead of
vim.schedule().
This commit is contained in:
@@ -133,9 +133,10 @@ describe('nvim_ui_send', function()
|
||||
|
||||
screen:expect_unchanged()
|
||||
|
||||
-- The TUI client queries OSC 11 on connect, so that precedes the payload.
|
||||
local bg_request = '\027]11;?\007'
|
||||
eq(bg_request .. 'Hello world', table.concat(read_data))
|
||||
-- On connect, these queries precede the payload.
|
||||
local mcursor_request = '\027[> q' -- kitty-multicursor (CSI > SP q) query.
|
||||
local bg_request = '\027]11;?\007' -- TUI client OSC 11 query.
|
||||
eq(mcursor_request .. bg_request .. 'Hello world', table.concat(read_data))
|
||||
end)
|
||||
|
||||
it('ignores ui_send event for UIs without stdout_tty', function()
|
||||
|
||||
Reference in New Issue
Block a user