diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-11-14 08:53:58 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 08:53:58 -0600 |
commit | ac8ed77afb359694a716501d9e87b0c9949b2445 (patch) | |
tree | b1345f64f8ecba162278325b750092ce405091ec /runtime | |
parent | b73a829837bbc05840ae00cbe514fb1786695614 (diff) | |
download | rneovim-ac8ed77afb359694a716501d9e87b0c9949b2445.tar.gz rneovim-ac8ed77afb359694a716501d9e87b0c9949b2445.tar.bz2 rneovim-ac8ed77afb359694a716501d9e87b0c9949b2445.zip |
feat(tui): add 'termsync' option (#25871)
The 'termsync' option enables a mode (provided the underlying terminal
supports it) where all screen updates during a redraw cycle are buffered
and drawn together when the redraw is complete. This eliminates tearing
or flickering in cases where Nvim redraws slower than the terminal
redraws the screen.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/news.txt | 3 | ||||
-rw-r--r-- | runtime/doc/options.txt | 8 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/options.lua | 9 |
3 files changed, 20 insertions, 0 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index ee48bddc4d..ae97772b66 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -211,6 +211,9 @@ The following new APIs and features were added. • A clipboard provider which uses OSC 52 to copy the selection to the system clipboard is now bundled by default. |clipboard-osc52| +• The 'termsync' option asks the terminal emulator to buffer screen updates + until the redraw cycle is complete. Requires support from the terminal. + ============================================================================== CHANGED FEATURES *news-changed* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 603b777f55..07326c8c13 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -6523,6 +6523,14 @@ A jump table for the options with a short description can be found at |Q_op|. C1 Control characters 0x80...0x9F + *'termsync'* *'notermsync'* +'termsync' boolean (default on) + global + If the host terminal supports it, buffer all screen updates + made during a redraw cycle so that each screen is displayed in + the terminal all at once. This can prevent tearing or flickering + when the terminal updates faster than Nvim can redraw. + *'textwidth'* *'tw'* 'textwidth' 'tw' number (default 0) local to buffer diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 0ef0fece90..19ae786177 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -6978,6 +6978,15 @@ vim.o.tpf = vim.o.termpastefilter vim.go.termpastefilter = vim.o.termpastefilter vim.go.tpf = vim.go.termpastefilter +--- If the host terminal supports it, buffer all screen updates +--- made during a redraw cycle so that each screen is displayed in +--- the terminal all at once. This can prevent tearing or flickering +--- when the terminal updates faster than Nvim can redraw. +--- +--- @type boolean +vim.o.termsync = true +vim.go.termsync = vim.o.termsync + --- Maximum width of text that is being inserted. A longer line will be --- broken after white space to get this width. A zero value disables --- this. |