aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-02-20 21:47:12 +0800
committerGitHub <noreply@github.com>2025-02-20 21:47:12 +0800
commit51cf84daf9612574978731e66db45a52136b8899 (patch)
tree5ac6f72c40e5219356ac198e1c20ca4df55354cf /runtime
parent574ea6a1911b740bb611f0b658a83f606b6837bc (diff)
downloadrneovim-51cf84daf9612574978731e66db45a52136b8899.tar.gz
rneovim-51cf84daf9612574978731e66db45a52136b8899.tar.bz2
rneovim-51cf84daf9612574978731e66db45a52136b8899.zip
feat(marks): virtual lines support horizontal scrolling (#32497)
Add a new field `virt_lines_overflow` that enables horizontal scrolling for virtual lines when set to "scroll".
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/api.txt6
-rw-r--r--runtime/doc/news.txt7
-rw-r--r--runtime/lua/vim/_meta/api.lua6
-rw-r--r--runtime/lua/vim/_meta/api_keysets.lua1
4 files changed, 17 insertions, 3 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index d3d18e9d6b..ec3dfebbc0 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -2651,6 +2651,12 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts})
• virt_lines_above: place virtual lines above instead.
• virt_lines_leftcol: Place virtual lines in the leftmost
column of the window, bypassing sign and number columns.
+ • virt_lines_overflow: controls how to handle virtual lines
+ wider than the window. Currently takes the one of the
+ following values:
+ • "trunc": truncate virtual lines on the right (default).
+ • "scroll": virtual lines can scroll horizontally with
+ 'nowrap', otherwise the same as "trunc".
• ephemeral : for use with |nvim_set_decoration_provider()|
callbacks. The mark will only be used for the current
redraw cycle, and not be permantently stored in the
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index da672f449c..f743bfc78b 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -202,9 +202,12 @@ API
• |nvim_echo()| `err` field to print error messages and `chunks` accepts
highlight group IDs.
• |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
+• |nvim_buf_set_extmark()| new field `virt_lines_overflow` accepts value `scroll` to
+ enable horizontal scrolling for virtual lines with 'nowrap'.
+ right aligned text that truncates before covering up buffer text.
+• |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
+• |nvim_buf_set_extmark()| `virt_text_pos` field accepts value `eol_right_align` to
allow for right aligned text that truncates before covering up buffer text.
DEFAULTS
diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua
index 96ee376882..a6ffb43146 100644
--- a/runtime/lua/vim/_meta/api.lua
+++ b/runtime/lua/vim/_meta/api.lua
@@ -641,7 +641,11 @@ function vim.api.nvim_buf_line_count(buffer) end
--- - virt_lines_leftcol: Place virtual lines in the leftmost
--- column of the window, bypassing
--- sign and number columns.
----
+--- - virt_lines_overflow: controls how to handle virtual lines wider
+--- than the window. Currently takes the one of the following values:
+--- - "trunc": truncate virtual lines on the right (default).
+--- - "scroll": virtual lines can scroll horizontally with 'nowrap',
+--- otherwise the same as "trunc".
--- - ephemeral : for use with `nvim_set_decoration_provider()`
--- callbacks. The mark will only be used for the current
--- redraw cycle, and not be permantently stored in the
diff --git a/runtime/lua/vim/_meta/api_keysets.lua b/runtime/lua/vim/_meta/api_keysets.lua
index 4d0665872b..a66e373851 100644
--- a/runtime/lua/vim/_meta/api_keysets.lua
+++ b/runtime/lua/vim/_meta/api_keysets.lua
@@ -258,6 +258,7 @@ error('Cannot require a meta file')
--- @field virt_lines? any[]
--- @field virt_lines_above? boolean
--- @field virt_lines_leftcol? boolean
+--- @field virt_lines_overflow? string
--- @field strict? boolean
--- @field sign_text? string
--- @field sign_hl_group? integer|string