diff options
| author | Luuk van Baal <luukvbaal@gmail.com> | 2024-04-10 11:42:46 +0200 |
|---|---|---|
| committer | Luuk van Baal <luukvbaal@gmail.com> | 2024-05-02 15:57:06 +0200 |
| commit | 037ea6e786b5d05f4a8965e4c2ba6aa60ec7c01a (patch) | |
| tree | d59f33ff739409f1a280d2c3f9b8140a814c9e38 /runtime/doc | |
| parent | 7b14eb543d43344e2498335dc93a68d200469516 (diff) | |
| download | rneovim-037ea6e786b5d05f4a8965e4c2ba6aa60ec7c01a.tar.gz rneovim-037ea6e786b5d05f4a8965e4c2ba6aa60ec7c01a.tar.bz2 rneovim-037ea6e786b5d05f4a8965e4c2ba6aa60ec7c01a.zip | |
feat(api): add nvim__redraw for more granular redrawing
Experimental and subject to future changes.
Add a way to redraw certain elements that are not redrawn while Nvim is waiting
for input, or currently have no API to do so. This API covers all that can be
done with the :redraw* commands, in addition to the following new features:
- Immediately move the cursor to a (non-current) window.
- Target a specific window or buffer to mark for redraw.
- Mark a buffer range for redraw (replaces nvim__buf_redraw_range()).
- Redraw the 'statuscolumn'.
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/api.txt | 29 | ||||
| -rw-r--r-- | runtime/doc/various.txt | 6 |
2 files changed, 34 insertions, 1 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index d15230ba2d..86f4c3875c 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1566,6 +1566,35 @@ nvim__invalidate_glyph_cache() *nvim__invalidate_glyph_cache()* For testing. The condition in schar_cache_clear_if_full is hard to reach, so this function can be used to force a cache clear in a test. +nvim__redraw({opts}) *nvim__redraw()* + EXPERIMENTAL: this API may change in the future. + + Instruct Nvim to redraw various components. + + Parameters: ~ + • {opts} Optional parameters. + • win: Target a specific |window-ID| as described below. + • buf: Target a specific buffer number as described below. + • flush: Update the screen with pending updates. + • valid: When present mark `win`, `buf`, or all windows for + redraw. When `true`, only redraw changed lines (useful for + decoration providers). When `false`, forcefully redraw. + • range: Redraw a range in `buf`, the buffer in `win` or the + current buffer (useful for decoration providers). Expects a + tuple `[first, last]` with the first and last line number of + the range, 0-based end-exclusive |api-indexing|. + • cursor: Immediately update cursor position on the screen in + `win` or the current window. + • statuscolumn: Redraw the 'statuscolumn' in `buf`, `win` or + all windows. + • statusline: Redraw the 'statusline' in `buf`, `win` or all + windows. + • winbar: Redraw the 'winbar' in `buf`, `win` or all windows. + • tabline: Redraw the 'tabline'. + + See also: ~ + • |:redraw| + nvim__stats() *nvim__stats()* Gets internal stats. diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index aa05d2bbb2..d41bdb5b00 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -14,6 +14,7 @@ Various commands *various* *CTRL-L* CTRL-L Clears and redraws the screen. The redraw may happen later, after processing typeahead. + See also |nvim__redraw()|. *CTRL-L-default* By default, also clears search highlighting |:nohlsearch| and updates diffs |:diffupdate|. @@ -21,6 +22,7 @@ CTRL-L Clears and redraws the screen. The redraw may happen *:mod* *:mode* :mod[e] Clears and redraws the screen. + See also |nvim__redraw()|. *:redr* *:redraw* :redr[aw][!] Redraws pending screen updates now, or the entire @@ -28,6 +30,7 @@ CTRL-L Clears and redraws the screen. The redraw may happen |:mode| or |CTRL-L|. Useful to update the screen during a script or function (or a mapping if 'lazyredraw' set). + See also |nvim__redraw()|. *:redraws* *:redrawstatus* :redraws[tatus][!] Redraws the status line and window bar of the current @@ -35,11 +38,12 @@ CTRL-L Clears and redraws the screen. The redraw may happen included. Redraws the commandline instead if it contains the 'ruler'. Useful if 'statusline' or 'winbar' includes an item that doesn't cause automatic updating. + See also |nvim__redraw()|. *:redrawt* *:redrawtabline* :redrawt[abline] Redraw the tabline. Useful to update the tabline when 'tabline' includes an item that doesn't trigger - automatic updating. + automatic updating. See also |nvim__redraw()|. *N<Del>* <Del> When entering a number: Remove the last digit. |