diff options
| author | georgev93 <39860568+georgev93@users.noreply.github.com> | 2025-01-24 22:57:45 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-24 19:57:45 -0800 |
| commit | 931ee5591fa764a769946318e05062098baf7c21 (patch) | |
| tree | 82dd7f486cc47d1e7a2d44d204ab12f967a5e0da /runtime/doc | |
| parent | c6d2cbf8f51abfa0c9d244ef384a15b0b69e16c6 (diff) | |
| download | rneovim-931ee5591fa764a769946318e05062098baf7c21.tar.gz rneovim-931ee5591fa764a769946318e05062098baf7c21.tar.bz2 rneovim-931ee5591fa764a769946318e05062098baf7c21.zip | |
feat(extmarks): virtual text can be right-aligned, truncated #31921
Problem: Right aligned virtual text can cover up buffer text if virtual
text is too long
Solution: An additional option for `virt_text_pos` called
`eol_right_align` has been added to truncate virtual text if it would
have otherwise covered up buffer text. This ensures the virtual text
extends no further left than EOL.
Diffstat (limited to 'runtime/doc')
| -rw-r--r-- | runtime/doc/api.txt | 7 | ||||
| -rw-r--r-- | runtime/doc/diagnostic.txt | 4 | ||||
| -rw-r--r-- | runtime/doc/news.txt | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index c5ade72f93..1a5df18f6c 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -2609,6 +2609,13 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts}) last). • virt_text_pos : position of virtual text. Possible values: • "eol": right after eol character (default). + • "eol_right_align": display right aligned in the window + unless the virtual text is longer than the space + available. If the virtual text is too long, it is + truncated to fit in the window after the EOL character. + If the line is wrapped, the virtual text is shown after + the end of the line rather than the previous screen + line. • "overlay": display over the specified column, without shifting the underlying text. • "right_align": display right aligned in the window. diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index d4939d8cc7..6b1456d5a6 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -626,8 +626,8 @@ Lua module: vim.diagnostic *diagnostic-api* • {hl_mode}? (`'replace'|'combine'|'blend'`) See |nvim_buf_set_extmark()|. • {virt_text}? (`[string,any][]`) See |nvim_buf_set_extmark()|. - • {virt_text_pos}? (`'eol'|'overlay'|'right_align'|'inline'`) See - |nvim_buf_set_extmark()|. + • {virt_text_pos}? (`'eol'|'eol_right_align'|'inline'|'overlay'|'right_align'`) + See |nvim_buf_set_extmark()|. • {virt_text_win_col}? (`integer`) See |nvim_buf_set_extmark()|. • {virt_text_hide}? (`boolean`) See |nvim_buf_set_extmark()|. diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 099fc17c5d..1d53f168ff 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -195,6 +195,8 @@ API • |nvim_open_win()| `relative` field can be set to "laststatus" and "tabline". • |nvim_buf_set_extmark()| `hl_group` field can be an array of layered groups • |vim.hl.range()| now has a optional `timeout` field which allows for a timed highlight +• |nvim_buf_set_extmark()| virt_text_pos accepts `eol_right_align` to + allow for right aligned text that truncates before covering up buffer text. DEFAULTS |