diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-11-15 15:55:19 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 15:55:19 -0600 |
commit | 405bad5e085fb359879646b6fd6fbcddae83eac5 (patch) | |
tree | 806e1c6ad394be99088ce3a0be0b91ecd066ee46 /src/nvim/api/ui.c | |
parent | d92dd2a0c05148154c353f0e7cd2099b2427308a (diff) | |
download | rneovim-405bad5e085fb359879646b6fd6fbcddae83eac5.tar.gz rneovim-405bad5e085fb359879646b6fd6fbcddae83eac5.tar.bz2 rneovim-405bad5e085fb359879646b6fd6fbcddae83eac5.zip |
fix(tui): do not toggle cursor visibility when flushing the buffer (#26055)
When writing large amounts of data to the tty it is common to first hide
the cursor to avoid a flickering effect. This has been done in Nvim for
a long time and was implemented in the function that actually flushed
the TUI buffer out to the TTY.
However, when using synchronized updates with the 'termsync' option this
is no longer necessary, as the terminal emulator will buffer all of the
updates and display them atomically. Thus there is no need to toggle the
cursor visibility when flushing the buffer when synchronized updates are
used. In fact, doing so can actually reintroduce cursor flickering in
certain scenarios because the visibility state is itself being
synchronized by the terminal.
In addition, the management of the cursor visibility should not happen
when the TUI _buffer_ is flushed, but rather when the TUI itself is
flushed. This is a subtle but meaningful distinction: the former
literally writes bytes to the TTY while the latter flushes the TUI's
grid into its buffer. There is no need to hide the cursor every time we
write bytes to the TTY, only at the beginning of a full TUI "flush"
event.
Diffstat (limited to 'src/nvim/api/ui.c')
0 files changed, 0 insertions, 0 deletions