diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-11-18 15:04:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-18 15:04:14 +0100 |
commit | df87266b23b32b96d1e3d4d26eb721a9dd63c2a4 (patch) | |
tree | ef277cb1f5aad32d85313a1044196df640074d32 /runtime | |
parent | cdc8bacc7945da816738e330555fa85d3ffffd56 (diff) | |
parent | c4afb9788c4f139eb2e3b7aa4d6a6a20b67ba156 (diff) | |
download | rneovim-df87266b23b32b96d1e3d4d26eb721a9dd63c2a4.tar.gz rneovim-df87266b23b32b96d1e3d4d26eb721a9dd63c2a4.tar.bz2 rneovim-df87266b23b32b96d1e3d4d26eb721a9dd63c2a4.zip |
Merge pull request #25724 from luukvbaal/signmerge
refactor(sign): move legacy signs to extmarks
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/api.txt | 4 | ||||
-rw-r--r-- | runtime/doc/news.txt | 8 | ||||
-rw-r--r-- | runtime/doc/options.txt | 6 | ||||
-rw-r--r-- | runtime/doc/sign.txt | 21 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/api.lua | 4 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/options.lua | 6 |
7 files changed, 21 insertions, 29 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 908198de4c..57491b34d6 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -2566,8 +2566,8 @@ nvim_buf_get_extmark_by_id({buffer}, {ns_id}, {id}, {opts}) *nvim_buf_get_extmarks()* nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {*opts}) - Gets |extmarks| in "traversal order" from a |charwise| region defined by - buffer positions (inclusive, 0-indexed |api-indexing|). + Gets |extmarks| (including |signs|) in "traversal order" from a |charwise| + region defined by buffer positions (inclusive, 0-indexed |api-indexing|). Region can be given as (row,col) tuples, or valid extmark ids (whose positions define the bounds). 0 and -1 are understood as (0,0) and (-1,-1) diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 59f419128d..8073a4f162 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -87,6 +87,14 @@ The following changes may require adaptations in user config or plugins. the option is set (e.g. using |:set| or |nvim_set_option_value()|) without a scope, which means they now behave the same way as string options. +• Signs placed through the legacy |sign-commands| are now stored and displayed + as |extmarks| internally. Along with the following changes: + • A sign placed twice in the same group with the same identifier will be moved. + • Legacy signs are always deleted along with the line it is placed on. + • Legacy and extmark signs will show up in both |:sign-place-list| and |nvim_buf_get_extmarks()|. + • Legacy and extmark signs are displayed and listed with the same priority: + line number -> priority -> sign id -> recently placed + ============================================================================== NEW FEATURES *news-features* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 07326c8c13..f47093782c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5624,12 +5624,6 @@ A jump table for the options with a short description can be found at |Q_op|. "number" display signs in the 'number' column. If the number column is not present, then behaves like "auto". - Note regarding "orphaned signs": with signcolumn numbers higher than - 1, deleting lines will also remove the associated signs automatically, - in contrast to the default Vim behavior of keeping and grouping them. - This is done in order for the signcolumn appearance not appear weird - during line deletion. - *'smartcase'* *'scs'* *'nosmartcase'* *'noscs'* 'smartcase' 'scs' boolean (default off) global diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index 8ecfadce17..733b0fe212 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -53,11 +53,10 @@ If 'cursorline' is enabled, then the CursorLineSign highlight group is used Each placed sign is identified by a number called the sign identifier. This identifier is used to jump to the sign or to remove the sign. The identifier is assigned when placing the sign using the |:sign-place| command or the -|sign_place()| function. Each sign identifier should be a unique number. If -multiple placed signs use the same identifier, then jumping to or removing a -sign becomes unpredictable. To avoid overlapping identifiers, sign groups can -be used. The |sign_place()| function can be called with a zero sign identifier -to allocate the next available identifier. +|sign_place()| function. Each sign identifier should be a unique number. +Placing the same identifier twice will move the previously placed sign. The +|sign_place()| function can be called with a zero sign identifier to allocate +the next available identifier. *sign-group* Each placed sign can be assigned to either the global group or a named group. @@ -77,9 +76,8 @@ When two signs with the same priority are present, and one has an icon or text in the signcolumn while the other has line highlighting, then both are displayed. -When the line on which the sign is placed is deleted, the sign is moved to the -next line (or the last line of the buffer, if there is no next line). When -the delete is undone the sign does not move back. +When the line on which the sign is placed is deleted, the sign is removed along +with it. ============================================================================== 2. Commands *sign-commands* *:sig* *:sign* @@ -177,11 +175,8 @@ See |sign_place()| for the equivalent Vim script function. space is ignored. The sign is remembered under {id}, this can be used for - further manipulation. {id} must be a number. - It's up to the user to make sure the {id} is used only once in - each file (if it's used several times unplacing will also have - to be done several times and making changes may not work as - expected). + further manipulation. {id} must be a number. Placing the + same {id} multiple times will move the sign. The following optional sign attributes can be specified before "file=": diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 5e09cc2481..cf9b3cf0e5 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -340,6 +340,7 @@ Shell: Signs: Signs are removed if the associated line is deleted. + Signs placed twice with the same identifier in the same group are moved. Startup: |-e| and |-es| invoke the same "improved Ex mode" as -E and -Es. diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 0c8979054f..006996ad4e 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -317,8 +317,8 @@ function vim.api.nvim_buf_get_commands(buffer, opts) end --- @return integer[] function vim.api.nvim_buf_get_extmark_by_id(buffer, ns_id, id, opts) end ---- Gets `extmarks` in "traversal order" from a `charwise` region defined by ---- buffer positions (inclusive, 0-indexed `api-indexing`). +--- Gets `extmarks` (including `signs`) in "traversal order" from a `charwise` +--- region defined by buffer positions (inclusive, 0-indexed `api-indexing`). --- Region can be given as (row,col) tuples, or valid extmark ids (whose --- positions define the bounds). 0 and -1 are understood as (0,0) and (-1,-1) --- respectively, thus the following are equivalent: diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index be4a4dd49c..d2bdab4d28 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -5923,12 +5923,6 @@ vim.go.siso = vim.go.sidescrolloff --- "number" display signs in the 'number' column. If the number --- column is not present, then behaves like "auto". --- ---- Note regarding "orphaned signs": with signcolumn numbers higher than ---- 1, deleting lines will also remove the associated signs automatically, ---- in contrast to the default Vim behavior of keeping and grouping them. ---- This is done in order for the signcolumn appearance not appear weird ---- during line deletion. ---- --- @type string vim.o.signcolumn = "auto" vim.o.scl = vim.o.signcolumn |