From b1577d371a6db43222de9e3a525def82320ebdb1 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Wed, 7 Feb 2024 21:44:42 +0000 Subject: fix(api): make win_set_config with "win" for splits need "split/vertical" Problem: currently, for splits, nvim_win_set_config accepts win without any of split or vertical set, which has little effect and seems error-prone. Solution: require at least one of split or vertical to also be set for splits. Also, update nvim_win_set_config docs, as it's no longer limited to just floating and external windows. --- runtime/lua/vim/_meta/api.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 94eab72291..4a179d49f3 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -2207,11 +2207,11 @@ function vim.api.nvim_win_remove_ns(window, ns_id) end --- @param buffer integer Buffer handle function vim.api.nvim_win_set_buf(window, buffer) end ---- Configures window layout. Currently only for floating and external windows ---- (including changing a split window to those layouts). +--- Configures window layout. Cannot be used to move the last window in a +--- tabpage to a different one. --- ---- When reconfiguring a floating window, absent option keys will not be ---- changed. `row`/`col` and `relative` must be reconfigured together. +--- When reconfiguring a window, absent option keys will not be changed. +--- `row`/`col` and `relative` must be reconfigured together. --- --- @param window integer Window handle, or 0 for current window --- @param config vim.api.keyset.win_config Map defining the window configuration, see `nvim_open_win()` -- cgit From a70eae57bd44208a77b5ac29839e8a39ab3c9cd8 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sun, 11 Feb 2024 22:53:37 +0000 Subject: fix(api): make open_win block only enter/leave events if !enter && !noautocmd Problem: nvim_open_win blocking all win_set_buf autocommands when !enter && !noautocmd is too aggressive. Solution: temporarily block WinEnter/Leave and BufEnter/Leave events when setting the buffer. Delegate the firing of BufWinEnter back to win_set_buf, which also has the advantage of keeping the timing consistent (e.g: before the epilogue in enter_buffer, which also handles restoring the cursor position if autocommands didn't change it, among other things). Reword the documentation for noautocmd a bit. I pondered modifying do_buffer and callees to allow for BufEnter/Leave being conditionally disabled, but it seems too invasive (and potentially error-prone, especially if new code paths to BufEnter/Leave are added in the future). Unfortunately, doing this has the drawback of blocking ALL such events for the duration, which also means blocking unrelated such events; like if window switching occurs in a ++nested autocmd fired by win_set_buf. If this turns out to be a problem in practice, a different solution specialized for nvim_open_win could be considered. :-) --- runtime/lua/vim/_meta/api.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 4a179d49f3..f2f5f43c26 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -1719,9 +1719,9 @@ function vim.api.nvim_open_term(buffer, opts) end --- • footer_pos: Footer position. Must be set with `footer` --- option. Value can be one of "left", "center", or "right". --- Default is `"left"`. ---- • noautocmd: If true then no buffer-related autocommand ---- events such as `BufEnter`, `BufLeave` or `BufWinEnter` may ---- fire from calling this function. +--- • noautocmd: If true then autocommands triggered from +--- setting the `buffer` to display are blocked (e.g: +--- `BufEnter`, `BufLeave`, `BufWinEnter`). --- • fixed: If true when anchor is NW or SW, the float window --- would be kept fixed even if the window would be truncated. --- • hide: If true the floating window will be hidden. -- cgit From 24dfa47e4f4ca41d0c5f8c1c0f851602362c81d3 Mon Sep 17 00:00:00 2001 From: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Sat, 24 Feb 2024 23:18:50 +0000 Subject: vim-patch:partial:9.1.0117: Stop split-moving from firing WinNew and WinNewPre autocommands Problem: win_splitmove fires WinNewPre and possibly WinNew when moving windows, even though no new windows are created. Solution: don't fire WinNew and WinNewPre when inserting an existing window, even if it isn't the current window. Improve the accuracy of related documentation. (Sean Dewar) https://github.com/vim/vim/commit/96cc4aef3d47d0fd70e68908af3d48a0dce8ea70 Partial as WinNewPre has not been ported yet (it currently has problems anyway). --- runtime/lua/vim/_meta/vimfn.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index ac25547212..ee68f669f8 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -10598,10 +10598,10 @@ function vim.fn.win_move_statusline(nr, offset) end --- @return any function vim.fn.win_screenpos(nr) end ---- Move the window {nr} to a new split of the window {target}. ---- This is similar to moving to {target}, creating a new window ---- using |:split| but having the same contents as window {nr}, and ---- then closing {nr}. +--- Temporarily switch to window {target}, then move window {nr} +--- to a new split adjacent to {target}. +--- Unlike commands such as |:split|, no new windows are created +--- (the |window-ID| of window {nr} is unchanged after the move). --- --- Both {nr} and {target} can be window numbers or |window-ID|s. --- Both must be in the current tab page. -- cgit From a09ddd7ce55037edc9747a682810fba6a26bc201 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sat, 9 Mar 2024 12:21:01 +0000 Subject: docs(editorconfig): move to source --- runtime/lua/vim/_meta/builtin.lua | 1 - 1 file changed, 1 deletion(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/builtin.lua b/runtime/lua/vim/_meta/builtin.lua index 9a67667f02..ef9821fa32 100644 --- a/runtime/lua/vim/_meta/builtin.lua +++ b/runtime/lua/vim/_meta/builtin.lua @@ -215,7 +215,6 @@ function vim.schedule(fn) end --- Examples: --- --- ```lua ---- --- --- --- -- Wait for 100 ms, allowing other events to process --- vim.wait(100, function() end) -- cgit From 141182d6c6c06ad56413b81a518ba9b777a0cbe0 Mon Sep 17 00:00:00 2001 From: Colin Kennedy Date: Mon, 25 Dec 2023 20:41:09 -0800 Subject: vim-patch:9.1.0147: Cannot keep a buffer focused in a window Problem: Cannot keep a buffer focused in a window (Amit Levy) Solution: Add the 'winfixbuf' window-local option (Colin Kennedy) fixes: vim/vim#6445 closes: vim/vim#13903 https://github.com/vim/vim/commit/215703563757a4464907ead6fb9edaeb7f430bea N/A patch: vim-patch:58f1e5c0893a --- runtime/lua/vim/_meta/options.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 757720d8fb..e9ac2fe08f 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -6746,6 +6746,8 @@ vim.bo.swf = vim.bo.swapfile --- "split" when both are present. --- uselast If included, jump to the previously used window when --- jumping to errors with `quickfix` commands. +--- If a window has 'winfixbuf' enabled, 'switchbuf' is currently not +--- applied to the split window. --- --- @type string vim.o.switchbuf = "uselast" @@ -7874,6 +7876,18 @@ vim.o.wi = vim.o.window vim.go.window = vim.o.window vim.go.wi = vim.go.window +--- If enabled, the buffer and any window that displays it are paired. +--- For example, attempting to change the buffer with `:edit` will fail. +--- Other commands which change a window's buffer such as `:cnext` will +--- also skip any window with 'winfixbuf' enabled. However if a command +--- has an "!" option, a window can be forced to switch buffers. +--- +--- @type boolean +vim.o.winfixbuf = false +vim.o.wfb = vim.o.winfixbuf +vim.wo.winfixbuf = vim.o.winfixbuf +vim.wo.wfb = vim.wo.winfixbuf + --- Keep the window height when windows are opened or closed and --- 'equalalways' is set. Also for `CTRL-W_=`. Set by default for the --- `preview-window` and `quickfix-window`. -- cgit From 9cc755ad6a60e2b028d61c1dca62f8fe20f652d7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 12 Mar 2024 05:39:21 +0800 Subject: vim-patch:0049a495c8d4 (#27817) runtime(doc): improve 'winfixbuf' docs (vim/vim#14180) - Make it not sound like a buffer option. - "!" is called a modifier, not an option. https://github.com/vim/vim/commit/0049a495c8d4a597773587f622d8cc8573c2eb75 --- runtime/lua/vim/_meta/options.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index e9ac2fe08f..cba52f0afa 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -7876,11 +7876,11 @@ vim.o.wi = vim.o.window vim.go.window = vim.o.window vim.go.wi = vim.go.window ---- If enabled, the buffer and any window that displays it are paired. +--- If enabled, the window and the buffer it is displaying are paired. --- For example, attempting to change the buffer with `:edit` will fail. --- Other commands which change a window's buffer such as `:cnext` will ---- also skip any window with 'winfixbuf' enabled. However if a command ---- has an "!" option, a window can be forced to switch buffers. +--- also skip any window with 'winfixbuf' enabled. However if an Ex +--- command has a "!" modifier, it can force switching buffers. --- --- @type boolean vim.o.winfixbuf = false -- cgit From ca7b603d02ecd1ed4098f487cd01acd470ca6a74 Mon Sep 17 00:00:00 2001 From: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Tue, 12 Mar 2024 21:08:50 +0000 Subject: vim-patch:9.1.0170: Re-allow curwin == prevwin, but document it instead Problem: more places exist where curwin == prevwin, and it may even be expected in some cases. Solution: revert v9.1.0001, but document that it's possible instead. (Sean Dewar) I've had a change of heart for the following reasons: - A quick 'n dirty [GitHub code search](https://github.com/search?q=%2F%28winnr%5C%28%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%7Cwinnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5C%29%29%2F&type=code) reveals some cases where it's expected in the wild. Particularly, it made me aware `winnr() == winnr('#')` is possible when curwin is changed temporarily during the evaluation of a &statusline expression item (`%{...}`), and is used to show something different on the statusline belonging to the previous window; that behaviour wasn't changed in v9.1.0001, but it means curwin == prevwin makes sense in some cases. - The definition and call sites of back_to_prevwin imply some expectation that prevwin == wp (== curwin) is possible, as it's used to skip entering the prevwin in that case. - Prior to v9.1.0001, `:wincmd p` would not beep in the case that was patched in v9.1.0001, but now does. That resulted in vim/vim#14047 being opened, as it affected the CtrlP plugin. I find it odd that `:wincmd p` had cases where it wouldn't beep despite doing nothing, but it may be preferable to keep things that way (or instead also beep if curwin == prevwin, if that's preferred). - After more digging, I found cases in win_free_mem, enter_tabpage, aucmd_restbuf and qf_open_new_cwindow where curwin == prevwin is possible (many of them from autocommands). Others probably exist too, especially in places where curwin is changed temporarily. fixes: vim/vim#14047 closes: vim/vim#14186 https://github.com/vim/vim/commit/d64801e913314d2e19dbb38f60e6d285238debff --- runtime/lua/vim/_meta/vimfn.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index ee68f669f8..a51f89227b 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -10724,7 +10724,9 @@ function vim.fn.winline() end --- # the number of the last accessed window (where --- |CTRL-W_p| goes to). If there is no previous --- window or it is in another tab page 0 is ---- returned. +--- returned. May refer to the current window in +--- some cases (e.g. when evaluating 'statusline' +--- expressions). --- {N}j the number of the Nth window below the --- current window (where |CTRL-W_j| goes to). --- {N}k the number of the Nth window above the current -- cgit From c048beef6c034a46e324fcea7210082d48db32ee Mon Sep 17 00:00:00 2001 From: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Tue, 12 Mar 2024 21:41:35 +0000 Subject: vim-patch:9a660d2883f9 runtime(doc): add reference to matchbufline() at :h search() related: vim/vim#14173 https://github.com/vim/vim/commit/9a660d2883f92b3a3761c964dc14363a8f70c8d8 Co-authored-by: Christian Brabandt --- runtime/lua/vim/_meta/vimfn.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index a51f89227b..2b93ea7d4e 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -7259,6 +7259,7 @@ function vim.fn.screenstring(row, col) end --- When a match has been found its line number is returned. --- If there is no match a 0 is returned and the cursor doesn't --- move. No error message is given. +--- To get the matched string, use |matchbufline()|. --- --- {flags} is a String, which can contain these character flags: --- 'b' search Backward instead of forward -- cgit From bbb68e2a034ad3aaea99178c09301ca458ee8dff Mon Sep 17 00:00:00 2001 From: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Wed, 13 Mar 2024 22:06:39 +0000 Subject: vim-patch:9.1.0175: wrong window positions with 'winfix{width,height}' (#27845) Problem: winframe functions incorrectly recompute window positions if the altframe wasn't adjacent to the closed frame, which is possible if adjacent windows had 'winfix{width,height}' set. Solution: recompute for windows within the parent of the altframe and closed frame. Skip this (as before) if the altframe was top/left, but only if adjacent to the closed frame, as positions won't change in that case. Also correct the return value documentation for win_screenpos. (Sean Dewar) The issue revealed itself after removing the win_comp_pos call below winframe_restore in win_splitmove. Similarly, wrong positions could result from windows closed in other tabpages, as win_free_mem uses winframe_remove (at least until it is entered later, where enter_tabpage calls win_comp_pos). NOTE: As win_comp_pos handles only curtab, it's possible via other means for positions in non-current tabpages to be wrong (e.g: after changing 'laststatus', 'showtabline', etc.). Given enter_tabpage recomputes it, maybe it's intentional as an optimization? Should probably be documented in win_screenpos then, but I won't address that here. closes: vim/vim#14191 Nvim: don't reuse "wp" for "topleft" in winframe_remove, so the change integrates better with the call to winframe_find_altwin before it. https://github.com/vim/vim/commit/5866bc3a0f54115d5982fdc09bdbe4c45069265a --- runtime/lua/vim/_meta/vimfn.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 2b93ea7d4e..fb5e2a727e 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -10592,8 +10592,7 @@ function vim.fn.win_move_statusline(nr, offset) end --- [1, 1], unless there is a tabline, then it is [2, 1]. --- {nr} can be the window number or the |window-ID|. Use zero --- for the current window. ---- Returns [0, 0] if the window cannot be found in the current ---- tabpage. +--- Returns [0, 0] if the window cannot be found. --- --- @param nr integer --- @return any -- cgit From 120c4ec855bc654ae067fafdb63bb16460d97c88 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 28 Feb 2024 18:47:47 +0100 Subject: fix(terminal): disable reflow again reverts https://github.com/neovim/neovim/commit/c855eee919f2d4edc9b9fa91b277454290fbabfe This setting introduces constant CI failures on macos (see https://github.com/neovim/neovim/issues/23762). --- runtime/lua/vim/_meta/options.lua | 3 --- 1 file changed, 3 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index cba52f0afa..ac366197cc 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -5195,9 +5195,6 @@ vim.wo.scr = vim.wo.scroll --- Minimum is 1, maximum is 100000. --- Only in `terminal` buffers. --- ---- Note: Lines that are not visible and kept in scrollback are not ---- reflown when the terminal buffer is resized horizontally. ---- --- @type integer vim.o.scrollback = -1 vim.o.scbk = vim.o.scrollback -- cgit From d326e04860427b0a6a0b66da86fae8e5d23c8a7c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 15 Mar 2024 08:05:59 +0800 Subject: vim-patch:9.1.0181: no overflow check for string formatting (#27863) Problem: no overflow check for string formatting Solution: Check message formatting function for overflow. (Chris van Willegen) closes: vim/vim#13799 https://github.com/vim/vim/commit/c35fc03dbd47582b256776fb11f11d8ceb24f8f0 Co-authored-by: Christ van Willegen --- runtime/lua/vim/_meta/vimfn.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index fb5e2a727e..da251f89ad 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -6520,6 +6520,9 @@ function vim.fn.prevnonblank(lnum) end --- echo printf("%1$*2$.*3$f", 1.4142135, 6, 2) --- < 1.41 --- +--- You will get an overflow error |E1510|, when the field-width +--- or precision will result in a string longer than 6400 chars. +--- --- *E1500* --- You cannot mix positional and non-positional arguments: >vim --- echo printf("%s%1$s", "One", "Two") -- cgit From 881f5e59173a4f1b9a4cb16e425709e40d79d0e9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 23 Mar 2024 16:33:53 +0800 Subject: vim-patch:9.1.0199: Not enough tests for the slice() function (#27991) Problem: Not enough tests for the slice() function. Solution: Test with multibyte chars, and in both Legacy and Vim9 script. Update docs to be clearer about how it treats composing chars. (zeertzjq) closes: vim/vim#14275 https://github.com/vim/vim/commit/ad38769030b5fa86aa0e8f1f0b4266690dfad4c9 --- runtime/lua/vim/_meta/vimfn.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index da251f89ad..caddd4dde2 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -8800,7 +8800,8 @@ function vim.fn.sinh(expr) end --- Similar to using a |slice| "expr[start : end]", but "end" is --- used exclusive. And for a string the indexes are used as --- character indexes instead of byte indexes. ---- Also, composing characters are not counted. +--- Also, composing characters are treated as a part of the +--- preceding base character. --- When {end} is omitted the slice continues to the last item. --- When {end} is -1 the last item is omitted. --- Returns an empty value if {start} or {end} are invalid. @@ -9208,8 +9209,8 @@ function vim.fn.strcharlen(string) end --- of byte index and length. --- When {skipcc} is omitted or zero, composing characters are --- counted separately. ---- When {skipcc} set to 1, Composing characters are ignored, ---- similar to |slice()|. +--- When {skipcc} set to 1, composing characters are treated as a +--- part of the preceding base character, similar to |slice()|. --- When a character index is used where a character does not --- exist it is omitted and counted as one character. For --- example: >vim @@ -9229,7 +9230,7 @@ function vim.fn.strcharpart(src, start, len, skipcc) end --- in String {string}. --- When {skipcc} is omitted or zero, composing characters are --- counted separately. ---- When {skipcc} set to 1, Composing characters are ignored. +--- When {skipcc} set to 1, composing characters are ignored. --- |strcharlen()| always does this. --- --- Returns zero on error. -- cgit From 3fd8292aaf215a17c3803ed84bc3b9dfd4931294 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 25 Mar 2024 19:04:23 +0100 Subject: vim-patch:ab01adf7c65b runtime(doc): Update options.txt closes: vim/vim#14295 https://github.com/vim/vim/commit/ab01adf7c65b4ee350b402ab3ef1e7dfa5e074f1 Co-authored-by: Song-Tianxiang <149415622+Song-Tianxiang@users.noreply.github.com> --- runtime/lua/vim/_meta/options.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index ac366197cc..2fdedef1de 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -6846,7 +6846,7 @@ vim.go.tpm = vim.go.tabpagemax --- appear wrong in many places. --- The value must be more than 0 and less than 10000. --- ---- There are four main ways to use tabs in Vim: +--- There are five main ways to use tabs in Vim: --- 1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4 --- (or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim --- will use a mix of tabs and spaces, but typing and will -- cgit From 3f3c7299a14ff0025487a416462d8c32d922e04a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 26 Mar 2024 18:30:17 +0800 Subject: docs: remove remaining mentions of hkmap (#28038) --- runtime/lua/vim/_meta/options.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 2fdedef1de..e8e56e86b2 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -11,10 +11,9 @@ vim.bo = vim.bo ---@field [integer] vim.wo vim.wo = vim.wo ---- Allow CTRL-_ in Insert and Command-line mode. This is default off, to ---- avoid that users that accidentally type CTRL-_ instead of SHIFT-_ get ---- into reverse Insert mode, and don't know how to get out. See ---- 'revins'. +--- Allow CTRL-_ in Insert mode. This is default off, to avoid that users +--- that accidentally type CTRL-_ instead of SHIFT-_ get into reverse +--- Insert mode, and don't know how to get out. See 'revins'. --- --- @type boolean vim.o.allowrevins = false -- cgit From a89ce89742db600665b69e58d5e1bc3dbee9d57b Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Thu, 28 Mar 2024 02:32:32 +0100 Subject: docs: fix typos (#27868) Co-authored-by: ite-usagi <77563904+ite-usagi@users.noreply.github.com> Co-authored-by: v-sim <56476039+v-sim@users.noreply.github.com> Co-authored-by: Evgeni Chasnovski Co-authored-by: zeertzjq Co-authored-by: Quico Augustijn Co-authored-by: nhld Co-authored-by: francisco souza <108725+fsouza@users.noreply.github.com> --- runtime/lua/vim/_meta/api.lua | 2 +- runtime/lua/vim/_meta/builtin.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index ed8128769d..678d6d3500 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -669,7 +669,7 @@ function vim.api.nvim_buf_set_lines(buffer, start, end_, strict_indexing, replac --- @return boolean function vim.api.nvim_buf_set_mark(buffer, name, line, col, opts) end ---- Sets the full file name for a buffer +--- Sets the full file name for a buffer, like `:file_f` --- --- @param buffer integer Buffer handle, or 0 for current buffer --- @param name string Buffer name diff --git a/runtime/lua/vim/_meta/builtin.lua b/runtime/lua/vim/_meta/builtin.lua index ef9821fa32..20b6d9dabe 100644 --- a/runtime/lua/vim/_meta/builtin.lua +++ b/runtime/lua/vim/_meta/builtin.lua @@ -115,7 +115,7 @@ function vim.stricmp(a, b) end --- Convert UTF-32 or UTF-16 {index} to byte index. If {use_utf16} is not --- supplied, it defaults to false (use UTF-32). Returns the byte index. --- ---- Invalid UTF-8 and NUL is treated like by |vim.str_byteindex()|. +--- Invalid UTF-8 and NUL is treated like in |vim.str_utfindex()|. --- An {index} in the middle of a UTF-16 sequence is rounded upwards to --- the end of that sequence. --- @param str string -- cgit From 4147302f4be3fe8a5dae3f20a336477cb5f507a4 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Tue, 26 Mar 2024 19:06:39 +0100 Subject: vim-patch:9.1.0211: page-wise scrolling does not support smooth-scrolling Problem: Page-wise scrolling with Ctrl-F/Ctrl-B implements it's own logic to change the topline and cursor. In doing so, skipcol is not handled properly for 'smoothscroll', and virtual lines. Solution: Re-use the logic from Ctrl-E/Ctrl-Y while staying backward compatible as much as possible. https://github.com/vim/vim/commit/b9f5b95b7bec2414a5a96010514702d99afea18e --- runtime/lua/vim/_meta/options.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index e8e56e86b2..2d78013208 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -6075,8 +6075,8 @@ vim.go.sta = vim.go.smarttab --- highlighted with `hl-NonText`. --- You may also want to add "lastline" to the 'display' option to show as --- much of the last line as possible. ---- NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y ---- and scrolling with the mouse. +--- NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y, +--- CTRL-B, CTRL-F and scrolling with the mouse. --- --- @type boolean vim.o.smoothscroll = false -- cgit From 2f638c0ac6275bebacd12671481642fa43d7ba10 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 28 Mar 2024 10:20:45 +0100 Subject: vim-patch:9.1.0215: Half-page scrolling does not support smooth-scrolling Problem: Page-wise scrolling with Ctrl-D/Ctrl-U implements it's own logic to change the topline and cursor. More logic than necessary for scrolling with Ctrl-F/Ctrl-B was removed in patch 9.1.0211. Solution: Re-use the logic from Ctrl-E/Ctrl-Y/Ctrl-F/Ctrl-B while staying backward compatible as much as possible. Restore some of the logic that determined how many lines will be scrolled (Luuk van Baal) https://github.com/vim/vim/commit/5a2e3ec9ac72b6e644fea4ebba7e632498296e2f --- runtime/lua/vim/_meta/options.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 2d78013208..adc42f9659 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -6076,7 +6076,7 @@ vim.go.sta = vim.go.smarttab --- You may also want to add "lastline" to the 'display' option to show as --- much of the last line as possible. --- NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y, ---- CTRL-B, CTRL-F and scrolling with the mouse. +--- CTRL-D, CTRL-U, CTRL-F, CTRL-B and scrolling with the mouse. --- --- @type boolean vim.o.smoothscroll = false @@ -7861,8 +7861,8 @@ vim.wo.winbl = vim.wo.winblend --- will scroll 'window' minus two lines, with a minimum of one. --- When 'window' is equal to 'lines' minus one CTRL-F and CTRL-B scroll --- in a much smarter way, taking care of wrapping lines. ---- When resizing the Vim window, the value is smaller than 1 or more than ---- or equal to 'lines' it will be set to 'lines' minus 1. +--- When resizing the Vim window, and the value is smaller than 1 or more +--- than or equal to 'lines' it will be set to 'lines' minus 1. --- Note: Do not confuse this with the height of the Vim window, use --- 'lines' for that. --- -- cgit From d223a7cbd2a204fffeb220fb18dfede8f4ef3e1f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 29 Mar 2024 17:49:25 +0800 Subject: vim-patch:9.1.0228: Two unrelated things are tested by a single test (#28093) Problem: Two unrelated things are tested by a single test. Solution: Split it into two, restoring the old Test_brace_single_line(). Add missing cleanup to some tests. (zeertzjq) closes: vim/vim#14323 https://github.com/vim/vim/commit/ad493ef3ea9ef7f2b0badcd2298883b5ab6e4ef4 --- runtime/lua/vim/_meta/options.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index adc42f9659..5e40851457 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -6075,8 +6075,7 @@ vim.go.sta = vim.go.smarttab --- highlighted with `hl-NonText`. --- You may also want to add "lastline" to the 'display' option to show as --- much of the last line as possible. ---- NOTE: only partly implemented, currently works with CTRL-E, CTRL-Y, ---- CTRL-D, CTRL-U, CTRL-F, CTRL-B and scrolling with the mouse. +--- NOTE: partly implemented, doesn't work yet for `gj` and `gk`. --- --- @type boolean vim.o.smoothscroll = false -- cgit From a500c5f808ccf0b678c935f00e0af4503a5bd724 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 5 Apr 2024 18:04:45 +0800 Subject: vim-patch:8.1.0815: dialog for file changed outside of Vim not tested (#28184) Problem: Dialog for file changed outside of Vim not tested. Solution: Add a test. Move FileChangedShell test. Add 'L' flag to feedkeys(). https://github.com/vim/vim/commit/5e66b42aae7c67a3ef67617d4bd43052ac2b73ce Co-authored-by: Bram Moolenaar --- runtime/lua/vim/_meta/vimfn.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index caddd4dde2..887c4b3cbe 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -1959,6 +1959,7 @@ function vim.fn.extendnew(expr1, expr2, expr3) end --- 't' Handle keys as if typed; otherwise they are handled as --- if coming from a mapping. This matters for undo, --- opening folds, etc. +--- 'L' Lowlevel input. Other flags are not used. --- 'i' Insert the string instead of appending (see above). --- 'x' Execute commands until typeahead is empty. This is --- similar to using ":normal!". You can call feedkeys() -- cgit From 0443f06b71c7a1563657765b35f7f3869300edc7 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 5 Apr 2024 18:07:36 +0200 Subject: docs: don't mention executable() can return -1 This cannot happen for neovim. --- runtime/lua/vim/_meta/vimfn.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 887c4b3cbe..c114c3b212 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -1598,11 +1598,10 @@ function vim.fn.eventhandler() end --- The result is a Number: --- 1 exists --- 0 does not exist ---- -1 not implemented on this system --- |exepath()| can be used to get the full path of an executable. --- --- @param expr any ---- @return 0|1|-1 +--- @return 0|1 function vim.fn.executable(expr) end --- Execute {command} and capture its output. -- cgit From d32cbef59551a1808caea2ddaeac323fdc18d6b6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 8 Apr 2024 06:11:31 +0800 Subject: vim-patch:9cd9e759ab1e (#28224) runtime(doc): Normalise builtin-function optional parameter formatting These should generally be formatted as func([{arg}]) and referenced as {arg} in the description. closes: vim/vim#14438 https://github.com/vim/vim/commit/9cd9e759ab1e6e6adb24a23648eed41e4d94d522 Co-authored-by: Doug Kearns --- runtime/lua/vim/_meta/vimfn.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index c114c3b212..e3c7495cf9 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -2703,14 +2703,14 @@ function vim.fn.getcellwidths() end function vim.fn.getchangelist(buf) end --- Get a single character from the user or input stream. ---- If [expr] is omitted, wait until a character is available. ---- If [expr] is 0, only get a character when one is available. +--- If {expr} is omitted, wait until a character is available. +--- If {expr} is 0, only get a character when one is available. --- Return zero otherwise. ---- If [expr] is 1, only check if a character is available, it is +--- If {expr} is 1, only check if a character is available, it is --- not consumed. Return zero if no character available. --- If you prefer always getting a string use |getcharstr()|. --- ---- Without [expr] and when [expr] is 0 a whole character or +--- Without {expr} and when {expr} is 0 a whole character or --- special key is returned. If it is a single character, the --- result is a Number. Use |nr2char()| to convert it to a String. --- Otherwise a String is returned with the encoded character. @@ -2720,11 +2720,11 @@ function vim.fn.getchangelist(buf) end --- also a String when a modifier (shift, control, alt) was used --- that is not included in the character. --- ---- When [expr] is 0 and Esc is typed, there will be a short delay +--- When {expr} is 0 and Esc is typed, there will be a short delay --- while Vim waits to see if this is the start of an escape --- sequence. --- ---- When [expr] is 1 only the first byte is returned. For a +--- When {expr} is 1 only the first byte is returned. For a --- one-byte character it is the character itself as a number. --- Use nr2char() to convert it to a String. --- @@ -2828,10 +2828,10 @@ function vim.fn.getcharsearch() end --- Get a single character from the user or input stream as a --- string. ---- If [expr] is omitted, wait until a character is available. ---- If [expr] is 0 or false, only get a character when one is +--- If {expr} is omitted, wait until a character is available. +--- If {expr} is 0 or false, only get a character when one is --- available. Return an empty string otherwise. ---- If [expr] is 1 or true, only check if a character is +--- If {expr} is 1 or true, only check if a character is --- available, it is not consumed. Return an empty string --- if no character is available. --- Otherwise this works like |getchar()|, except that a number @@ -5993,7 +5993,7 @@ function vim.fn.min(expr) end function vim.fn.mkdir(name, flags, prot) end --- Return a string that indicates the current mode. ---- If [expr] is supplied and it evaluates to a non-zero Number or +--- If {expr} is supplied and it evaluates to a non-zero Number or --- a non-empty String (|non-zero-arg|), then the full mode is --- returned, otherwise only the first letter is returned. --- Also see |state()|. -- cgit From 7180ef690180cf92d1d49811820c46dd60e4d1c6 Mon Sep 17 00:00:00 2001 From: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Mon, 15 Apr 2024 00:10:16 +0100 Subject: feat(api)!: nvim_open_win: noautocmd blocks all autocmds #28192 Problem: noautocmd is confusing; despite its name, it doesn't block all autocommands (instead it blocks only those related to setting the buffer), and is commonly used by plugins to open windows while producing minimal side-effects. Solution: be consistent and block all autocommands when noautocmd is set. This includes WinNew (again), plus autocommands from entering the window (if enter is set) like WinEnter, WinLeave, TabEnter, .etc. See the discussion at https://github.com/neovim/neovim/pull/14659#issuecomment-2040029517 for more information. Remove win_set_buf's noautocmd argument, as it's no longer needed. NOTE: pum_create_float_preview sets noautocmd for win_set_buf, but all its callers already use block_autocmds. Despite that, pum_create_float_preview doesn't actually properly handle autocommands (it has no checks for whether those from win_enter or nvim_create_buf free the window). For now, ensure autocommands are blocked within it for correctness (in case it's ever called outside of a block_autocmds context; the function seems to have been refactored in #26739 anyway). --- runtime/lua/vim/_meta/api.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 678d6d3500..f56c256da6 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -1718,9 +1718,8 @@ function vim.api.nvim_open_term(buffer, opts) end --- • footer_pos: Footer position. Must be set with `footer` --- option. Value can be one of "left", "center", or "right". --- Default is `"left"`. ---- • noautocmd: If true then autocommands triggered from ---- setting the `buffer` to display are blocked (e.g: ---- `BufEnter`, `BufLeave`, `BufWinEnter`). +--- • noautocmd: If true then all autocommands are blocked for +--- the duration of the call. --- • fixed: If true when anchor is NW or SW, the float window --- would be kept fixed even if the window would be truncated. --- • hide: If true the floating window will be hidden. -- cgit From 43f8d7e3ef2db733f01f2d4c03214cd90c5a09be Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 15 Apr 2024 07:11:39 +0800 Subject: vim-patch:9.1.0329: String interpolation fails for Dict type (#28335) Problem: String interpolation fails for Dict type Solution: Support Dict data type properly, also support :put =Dict (without having to convert it to string() first) (Yegappan Lakshmanan) fixes: vim/vim#14529 closes: vim/vim#14541 https://github.com/vim/vim/commit/f01493c55062c01b1cdf9b1e946577f4d1bdddf3 Co-authored-by: Yegappan Lakshmanan --- runtime/lua/vim/_meta/vimfn.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index e3c7495cf9..d010673d24 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -9353,10 +9353,10 @@ function vim.fn.stridx(haystack, needle, start) end --- for infinite and NaN floating-point values representations --- which use |str2float()|. Strings are also dumped literally, --- only single quote is escaped, which does not allow using YAML ---- for parsing back binary strings. |eval()| should always work for ---- strings and floats though and this is the only official ---- method, use |msgpackdump()| or |json_encode()| if you need to ---- share data with other application. +--- for parsing back binary strings. |eval()| should always work +--- for strings and floats though, and this is the only official +--- method. Use |msgpackdump()| or |json_encode()| if you need to +--- share data with other applications. --- --- @param expr any --- @return string -- cgit From 20b38677c22b0ff19ea54396c7718b5a8f410ed4 Mon Sep 17 00:00:00 2001 From: Luna Saphie Mittelbach Date: Sun, 14 Apr 2024 12:54:10 +0200 Subject: feat(defaults): use ripgrep (rg) for 'grepprg' if available --- runtime/lua/vim/_meta/options.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 5e40851457..e10eb305b1 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -2625,6 +2625,8 @@ vim.go.gd = vim.go.gdefault --- This is a scanf-like string that uses the same format as the --- 'errorformat' option: see `errorformat`. --- +--- If ripgrep ('grepprg') is available, this option defaults to `%f:%l:%c:%m`. +--- --- @type string vim.o.grepformat = "%f:%l:%m,%f:%l%m,%f %l%m" vim.o.gfm = vim.o.grepformat @@ -2649,6 +2651,16 @@ vim.go.gfm = vim.go.grepformat --- apply equally to 'grepprg'. --- This option cannot be set from a `modeline` or in the `sandbox`, for --- security reasons. +--- This option defaults to: +--- - `rg --vimgrep -uuu $* ...` if ripgrep is available (`:checkhealth`), +--- - `grep -n $* /dev/null` on Unix, +--- - `findstr /n $* nul` on Windows. +--- Ripgrep can perform additional filtering such as using .gitignore rules +--- and skipping hidden or binary files. This is disabled by default (see the -u option) +--- to more closely match the behaviour of standard grep. +--- You can make ripgrep match Vim's case handling using the +--- -i/--ignore-case and -S/--smart-case options. +--- An `OptionSet` autocmd can be used to set it up to match automatically. --- --- @type string vim.o.grepprg = "grep -n $* /dev/null" -- cgit From b8273c9a339626078d49e706d882878090b07d42 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 26 Apr 2024 14:07:47 +0100 Subject: fix: lua annotations --- runtime/lua/vim/_meta/base64.lua | 4 +- runtime/lua/vim/_meta/builtin.lua | 25 ++++++------ runtime/lua/vim/_meta/diff.lua | 85 ++++++++++++++++++++------------------- runtime/lua/vim/_meta/re.lua | 4 +- runtime/lua/vim/_meta/spell.lua | 6 +-- 5 files changed, 62 insertions(+), 62 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/base64.lua b/runtime/lua/vim/_meta/base64.lua index f25b4af234..8ba59e1703 100644 --- a/runtime/lua/vim/_meta/base64.lua +++ b/runtime/lua/vim/_meta/base64.lua @@ -3,11 +3,11 @@ --- Encode {str} using Base64. --- --- @param str string String to encode ---- @return string Encoded string +--- @return string : Encoded string function vim.base64.encode(str) end --- Decode a Base64 encoded string. --- --- @param str string Base64 encoded string ---- @return string Decoded string +--- @return string : Decoded string function vim.base64.decode(str) end diff --git a/runtime/lua/vim/_meta/builtin.lua b/runtime/lua/vim/_meta/builtin.lua index 20b6d9dabe..75737bd040 100644 --- a/runtime/lua/vim/_meta/builtin.lua +++ b/runtime/lua/vim/_meta/builtin.lua @@ -119,15 +119,15 @@ function vim.stricmp(a, b) end --- An {index} in the middle of a UTF-16 sequence is rounded upwards to --- the end of that sequence. --- @param str string ---- @param index number ---- @param use_utf16? any +--- @param index integer +--- @param use_utf16? boolean function vim.str_byteindex(str, index, use_utf16) end --- Gets a list of the starting byte positions of each UTF-8 codepoint in the given string. --- --- Embedded NUL bytes are treated as terminating the string. --- @param str string ---- @return table +--- @return integer[] function vim.str_utf_pos(str) end --- Gets the distance (in bytes) from the starting byte of the codepoint (character) that {index} @@ -148,8 +148,8 @@ function vim.str_utf_pos(str) end --- ``` --- --- @param str string ---- @param index number ---- @return number +--- @param index integer +--- @return integer function vim.str_utf_start(str, index) end --- Gets the distance (in bytes) from the last byte of the codepoint (character) that {index} points @@ -168,8 +168,8 @@ function vim.str_utf_start(str, index) end --- ``` --- --- @param str string ---- @param index number ---- @return number +--- @param index integer +--- @return integer function vim.str_utf_end(str, index) end --- Convert byte index to UTF-32 and UTF-16 indices. If {index} is not @@ -180,7 +180,7 @@ function vim.str_utf_end(str, index) end --- {index} in the middle of a UTF-8 sequence is rounded upwards to the end of --- that sequence. --- @param str string ---- @param index? number +--- @param index? integer --- @return integer UTF-32 index --- @return integer UTF-16 index function vim.str_utfindex(str, index) end @@ -193,15 +193,14 @@ function vim.str_utfindex(str, index) end --- can accept, see ":Man 3 iconv". --- --- @param str string Text to convert ---- @param from number Encoding of {str} ---- @param to number Target encoding ---- @param opts? table ---- @return string|nil Converted string if conversion succeeds, `nil` otherwise. +--- @param from string Encoding of {str} +--- @param to string Target encoding +--- @return string? : Converted string if conversion succeeds, `nil` otherwise. function vim.iconv(str, from, to, opts) end --- Schedules {fn} to be invoked soon by the main event-loop. Useful --- to avoid |textlock| or other temporary restrictions. ---- @param fn function +--- @param fn fun() function vim.schedule(fn) end --- Wait for {time} in milliseconds until {callback} returns `true`. diff --git a/runtime/lua/vim/_meta/diff.lua b/runtime/lua/vim/_meta/diff.lua index f265139448..617bc87f59 100644 --- a/runtime/lua/vim/_meta/diff.lua +++ b/runtime/lua/vim/_meta/diff.lua @@ -1,5 +1,46 @@ ---@meta +--- Optional parameters: +--- @class vim.diff.Opts +--- @inlinedoc +--- +--- Invoked for each hunk in the diff. Return a negative number +--- to cancel the callback for any remaining hunks. +--- Arguments: +--- - `start_a` (`integer`): Start line of hunk in {a}. +--- - `count_a` (`integer`): Hunk size in {a}. +--- - `start_b` (`integer`): Start line of hunk in {b}. +--- - `count_b` (`integer`): Hunk size in {b}. +--- @field on_hunk fun(start_a: integer, count_a: integer, start_b: integer, count_b: integer): integer +--- +--- Form of the returned diff: +--- - `unified`: String in unified format. +--- - `indices`: Array of hunk locations. +--- Note: This option is ignored if `on_hunk` is used. +--- (default: `'unified'`) +--- @field result_type 'unified'|'indices' +--- +--- Run linematch on the resulting hunks from xdiff. When integer, only hunks +--- upto this size in lines are run through linematch. +--- Requires `result_type = indices`, ignored otherwise. +--- @field linematch boolean|integer +--- +--- Diff algorithm to use. Values: +--- - `myers`: the default algorithm +--- - `minimal`: spend extra time to generate the smallest possible diff +--- - `patience`: patience diff algorithm +--- - `histogram`: histogram diff algorithm +--- (default: `'myers'`) +--- @field algorithm 'myers'|'minimal'|'patience'|'histogram' +--- @field ctxlen integer Context length +--- @field interhunkctxlen integer Inter hunk context length +--- @field ignore_whitespace boolean Ignore whitespace +--- @field ignore_whitespace_change boolean Ignore whitespace change +--- @field ignore_whitespace_change_at_eol boolean Ignore whitespace change at end-of-line. +--- @field ignore_cr_at_eol boolean Ignore carriage return at end-of-line +--- @field ignore_blank_lines boolean Ignore blank lines +--- @field indent_heuristic boolean Use the indent heuristic for the internal diff library. + -- luacheck: no unused args --- Run diff on strings {a} and {b}. Any indices returned by this function, @@ -24,47 +65,7 @@ --- ---@param a string First string to compare ---@param b string Second string to compare ----@param opts table Optional parameters: ---- - `on_hunk` (callback): ---- Invoked for each hunk in the diff. Return a negative number ---- to cancel the callback for any remaining hunks. ---- Args: ---- - `start_a` (integer): Start line of hunk in {a}. ---- - `count_a` (integer): Hunk size in {a}. ---- - `start_b` (integer): Start line of hunk in {b}. ---- - `count_b` (integer): Hunk size in {b}. ---- - `result_type` (string): Form of the returned diff: ---- - "unified": (default) String in unified format. ---- - "indices": Array of hunk locations. ---- Note: This option is ignored if `on_hunk` is used. ---- - `linematch` (boolean|integer): Run linematch on the resulting hunks ---- from xdiff. When integer, only hunks upto this size in ---- lines are run through linematch. Requires `result_type = indices`, ---- ignored otherwise. ---- - `algorithm` (string): ---- Diff algorithm to use. Values: ---- - "myers" the default algorithm ---- - "minimal" spend extra time to generate the ---- smallest possible diff ---- - "patience" patience diff algorithm ---- - "histogram" histogram diff algorithm ---- - `ctxlen` (integer): Context length ---- - `interhunkctxlen` (integer): ---- Inter hunk context length ---- - `ignore_whitespace` (boolean): ---- Ignore whitespace ---- - `ignore_whitespace_change` (boolean): ---- Ignore whitespace change ---- - `ignore_whitespace_change_at_eol` (boolean) ---- Ignore whitespace change at end-of-line. ---- - `ignore_cr_at_eol` (boolean) ---- Ignore carriage return at end-of-line ---- - `ignore_blank_lines` (boolean) ---- Ignore blank lines ---- - `indent_heuristic` (boolean): ---- Use the indent heuristic for the internal ---- diff library. ---- ----@return string|table|nil +---@param opts vim.diff.Opts +---@return string|integer[][]? --- See {opts.result_type}. `nil` if {opts.on_hunk} is given. function vim.diff(a, b, opts) end diff --git a/runtime/lua/vim/_meta/re.lua b/runtime/lua/vim/_meta/re.lua index 14c94c7824..9721e6f8c8 100644 --- a/runtime/lua/vim/_meta/re.lua +++ b/runtime/lua/vim/_meta/re.lua @@ -30,8 +30,8 @@ function vim.re.compile(string, defs) end --- @param subject string --- @param pattern vim.lpeg.Pattern|string --- @param init? integer ---- @return integer|nil the index where the occurrence starts, nil if no match ---- @return integer|nil the index where the occurrence ends, nil if no match +--- @return integer|nil : the index where the occurrence starts, nil if no match +--- @return integer|nil : the index where the occurrence ends, nil if no match function vim.re.find(subject, pattern, init) end --- Does a global substitution, replacing all occurrences of {pattern} in the given {subject} by diff --git a/runtime/lua/vim/_meta/spell.lua b/runtime/lua/vim/_meta/spell.lua index 57f2180895..c636db3b53 100644 --- a/runtime/lua/vim/_meta/spell.lua +++ b/runtime/lua/vim/_meta/spell.lua @@ -3,11 +3,11 @@ -- luacheck: no unused args --- Check {str} for spelling errors. Similar to the Vimscript function ---- |spellbadword()|. +--- [spellbadword()]. --- --- Note: The behaviour of this function is dependent on: 'spelllang', --- 'spellfile', 'spellcapcheck' and 'spelloptions' which can all be local to ---- the buffer. Consider calling this with |nvim_buf_call()|. +--- the buffer. Consider calling this with [nvim_buf_call()]. --- --- Example: --- @@ -20,7 +20,7 @@ --- ``` --- --- @param str string ---- @return {[1]: string, [2]: string, [3]: string}[] +--- @return {[1]: string, [2]: 'bad'|'rare'|'local'|'caps', [3]: integer}[] --- List of tuples with three items: --- - The badly spelled word. --- - The type of the spelling error: -- cgit From f1f5fb911b575372fef49a13d86079b5902ada76 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 27 Apr 2024 05:50:46 +0800 Subject: vim-patch:fe1e2b5e2d65 runtime(doc): clarify syntax vs matching mechanism fixes: vim/vim#14643 https://github.com/vim/vim/commit/fe1e2b5e2d65f05d820f17db935b15454a63be06 Co-authored-by: Christian Brabandt --- runtime/lua/vim/_meta/vimfn.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index d010673d24..02d5eaf575 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -9752,6 +9752,10 @@ function vim.fn.synIDtrans(synID) end --- synconcealed(lnum, 5) [1, 'X', 2] --- synconcealed(lnum, 6) [0, '', 0] --- +--- Note: Doesn't consider |matchadd()| highlighting items, +--- since syntax and matching highlighting are two different +--- mechanisms |syntax-vs-match|. +--- --- @param lnum integer --- @param col integer --- @return {[1]: integer, [2]: string, [3]: integer} -- cgit From 513fc461957f370f9e89b3cfd56cb03a816d6941 Mon Sep 17 00:00:00 2001 From: Luna Saphie Mittelbach Date: Sun, 28 Apr 2024 18:00:48 +0200 Subject: feat(defaults): improve :grep defaults #28545 Based on feedback from #28324, pass -H and -I to regular grep (available on all platforms officially supported by Neovim), and only pass -uu to ripgrep. This makes :grep ignore binary files by default in both cases. --- runtime/lua/vim/_meta/options.lua | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index e10eb305b1..9aa20f59bc 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -2638,12 +2638,6 @@ vim.go.gfm = vim.go.grepformat --- line. The placeholder "$*" is allowed to specify where the arguments --- will be included. Environment variables are expanded `:set_env`. See --- `option-backslash` about including spaces and backslashes. ---- When your "grep" accepts the "-H" argument, use this to make ":grep" ---- also work well with a single file: ---- ---- ```vim ---- set grepprg=grep\ -nH ---- ``` --- Special value: When 'grepprg' is set to "internal" the `:grep` command --- works like `:vimgrep`, `:lgrep` like `:lvimgrep`, `:grepadd` like --- `:vimgrepadd` and `:lgrepadd` like `:lvimgrepadd`. @@ -2652,18 +2646,18 @@ vim.go.gfm = vim.go.grepformat --- This option cannot be set from a `modeline` or in the `sandbox`, for --- security reasons. --- This option defaults to: ---- - `rg --vimgrep -uuu $* ...` if ripgrep is available (`:checkhealth`), ---- - `grep -n $* /dev/null` on Unix, +--- - `rg --vimgrep -uu ` if ripgrep is available (`:checkhealth`), +--- - `grep -HIn $* /dev/null` on Unix, --- - `findstr /n $* nul` on Windows. --- Ripgrep can perform additional filtering such as using .gitignore rules ---- and skipping hidden or binary files. This is disabled by default (see the -u option) +--- and skipping hidden files. This is disabled by default (see the -u option) --- to more closely match the behaviour of standard grep. --- You can make ripgrep match Vim's case handling using the --- -i/--ignore-case and -S/--smart-case options. --- An `OptionSet` autocmd can be used to set it up to match automatically. --- --- @type string -vim.o.grepprg = "grep -n $* /dev/null" +vim.o.grepprg = "grep -HIn $* /dev/null" vim.o.gp = vim.o.grepprg vim.bo.grepprg = vim.o.grepprg vim.bo.gp = vim.bo.grepprg -- cgit From 234b5f67019b435b604308a96c366b1187c2cc3a Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Tue, 30 Apr 2024 01:04:42 +0200 Subject: docs: various fixes (#28208) Co-authored-by: Evgeni Chasnovski Co-authored-by: Famiu Haque Co-authored-by: Gregory Anders Co-authored-by: Guilherme Soares Co-authored-by: Jannik Buhr Co-authored-by: thomaswuhoileong <72001875+thomaswuhoileong@users.noreply.github.com> Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com> Co-authored-by: zeertzjq --- runtime/lua/vim/_meta/options.lua | 2 +- runtime/lua/vim/_meta/vimfn.lua | 2 +- runtime/lua/vim/_meta/vvars.lua | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 9aa20f59bc..b51f82401b 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -974,7 +974,7 @@ vim.bo.comments = vim.o.comments vim.bo.com = vim.bo.comments --- A template for a comment. The "%s" in the value is replaced with the ---- comment text. For example, C uses "/*%s*/". Currently only used to +--- comment text. For example, C uses "/*%s*/". Used for `commenting` and to --- add markers for folding, see `fold-marker`. --- --- @type string diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 02d5eaf575..74b8590924 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -6583,7 +6583,7 @@ function vim.fn.prevnonblank(lnum) end --- --- @param fmt any --- @param expr1? any ---- @return any +--- @return string function vim.fn.printf(fmt, expr1) end --- Returns the effective prompt text for buffer {buf}. {buf} can diff --git a/runtime/lua/vim/_meta/vvars.lua b/runtime/lua/vim/_meta/vvars.lua index ee6d8ddf35..1660d1dd6c 100644 --- a/runtime/lua/vim/_meta/vvars.lua +++ b/runtime/lua/vim/_meta/vvars.lua @@ -54,9 +54,10 @@ vim.v.cmdbang = ... --- @type string vim.v.collate = ... ---- Dictionary containing the most recent `complete-items` after ---- `CompleteDone`. Empty if the completion failed, or after ---- leaving and re-entering insert mode. +--- Dictionary containing the `complete-items` for the most +--- recently completed word after `CompleteDone`. Empty if the +--- completion failed, or after leaving and re-entering insert +--- mode. --- Note: Plugins can modify the value to emulate the builtin --- `CompleteDone` event behavior. --- @type any -- cgit From 71cf75f96a67aeb79ac3af6aa829bac81bd2d33d Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 30 Apr 2024 04:30:21 -0700 Subject: docs: misc #24163 - Also delete old perl scripts which are not used since 8+ years ago. fix #23251 fix #27367 ref https://github.com/neovim/neovim/issues/2252#issuecomment-1902662577 Helped-by: Daniel Kongsgaard Co-authored-by: Kevin Pham --- runtime/lua/vim/_meta/api.lua | 6 +++--- runtime/lua/vim/_meta/options.lua | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index f56c256da6..7d20d90990 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -897,8 +897,8 @@ function vim.api.nvim_create_augroup(name, opts) end --- • callback (function|string) optional: Lua function (or --- Vimscript function name, if string) called when the event(s) --- is triggered. Lua callback can return a truthy value (not ---- `false` or `nil`) to delete the autocommand. Receives a ---- table argument with these keys: +--- `false` or `nil`) to delete the autocommand. Receives one +--- argument, a table with these keys: *event-args* --- • id: (number) autocommand id --- • event: (string) name of the triggered event --- `autocmd-events` @@ -907,7 +907,7 @@ function vim.api.nvim_create_augroup(name, opts) end --- • buf: (number) expanded value of --- • file: (string) expanded value of --- • data: (any) arbitrary data passed from ---- `nvim_exec_autocmds()` +--- `nvim_exec_autocmds()` *event-data* --- • command (string) optional: Vim command to execute on event. --- Cannot be used with {callback} --- • once (boolean) optional: defaults to false. Run the diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index b51f82401b..428b7c4d4f 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -7446,6 +7446,7 @@ vim.bo.vts = vim.bo.vartabstop --- --- Level Messages ~ --- ---------------------------------------------------------------------- +--- 1 Enables Lua tracing (see above). Does not produce messages. --- 2 When a file is ":source"'ed, or `shada` file is read or written. --- 3 UI info, terminal capabilities. --- 4 Shell commands. -- cgit From 0330dd9e69de7567fd2479c0203b778a1d2dce2f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 30 Apr 2024 05:12:51 -0700 Subject: fix(api): mark nvim__complete_set as experimental #28579 Problem: nvim_complete_set was added in 5ed55ff14c8b7e346811cb6228bf63fb5106bae9 but needs more bake time. Solution: Rename it, mark it as experimental. --- runtime/lua/vim/_meta/api.lua | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 7d20d90990..58fa9af8cd 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -23,6 +23,19 @@ function vim.api.nvim__buf_redraw_range(buffer, first, last) end --- @return table function vim.api.nvim__buf_stats(buffer) end +--- @private +--- EXPERIMENTAL: this api may change in the future. +--- +--- Sets info for the completion item at the given index. If the info text was +--- shown in a window, returns the window and buffer ids, or empty dict if not +--- shown. +--- +--- @param index integer Completion candidate index +--- @param opts vim.api.keyset.complete_set Optional parameters. +--- • info: (string) info text. +--- @return table +function vim.api.nvim__complete_set(index, opts) end + --- @private --- @return string function vim.api.nvim__get_lib_dir() end @@ -822,16 +835,6 @@ function vim.api.nvim_command(command) end --- @return string function vim.api.nvim_command_output(command) end ---- Set info for the completion candidate index. if the info was shown in a ---- window, then the window and buffer ids are returned for further ---- customization. If the text was not shown, an empty dict is returned. ---- ---- @param index integer the completion candidate index ---- @param opts vim.api.keyset.complete_set Optional parameters. ---- • info: (string) info text. ---- @return table -function vim.api.nvim_complete_set(index, opts) end - --- Create or get an autocommand group `autocmd-groups`. --- --- To get an existing group id, do: -- cgit From dafa51c16d9bdaec5011b591b0ce8dff287624b7 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 30 Apr 2024 06:06:14 -0700 Subject: docs(api): sort unreleased nvim__ functions last #28580 --- runtime/lua/vim/_meta/api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 58fa9af8cd..d799446647 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -24,7 +24,7 @@ function vim.api.nvim__buf_redraw_range(buffer, first, last) end function vim.api.nvim__buf_stats(buffer) end --- @private ---- EXPERIMENTAL: this api may change in the future. +--- EXPERIMENTAL: this API may change in the future. --- --- Sets info for the completion item at the given index. If the info text was --- shown in a window, returns the window and buffer ids, or empty dict if not -- cgit From 0b8a72b73934d33a05e20c255298e88cd921df32 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Wed, 1 May 2024 08:08:22 -0500 Subject: revert: "feat(extmarks): subpriorities (relative to declaration order) (#27131)" (#28585) This reverts commit 15e77a56b711102fdc123e15b3f37d49bc0b1df1. Subpriorities were added in https://github.com/neovim/neovim/pull/27131 as a mechanism for enforcing query order when using iter_matches in the Tree-sitter highlighter. However, iter_matches proved to have too many complications to use in the highlighter so we eventually reverted back to using iter_captures (https://github.com/neovim/neovim/pull/27901). Thus, subpriorities are no longer needed and can be removed. --- runtime/lua/vim/_meta/api_keysets.lua | 1 - 1 file changed, 1 deletion(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api_keysets.lua b/runtime/lua/vim/_meta/api_keysets.lua index 37e4372196..9f9ade3e76 100644 --- a/runtime/lua/vim/_meta/api_keysets.lua +++ b/runtime/lua/vim/_meta/api_keysets.lua @@ -253,7 +253,6 @@ error('Cannot require a meta file') --- @field undo_restore? boolean --- @field url? string --- @field scoped? boolean ---- @field _subpriority? integer --- @class vim.api.keyset.user_command --- @field addr? any -- cgit From 037ea6e786b5d05f4a8965e4c2ba6aa60ec7c01a Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Wed, 10 Apr 2024 11:42:46 +0200 Subject: 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'. --- runtime/lua/vim/_meta/api.lua | 32 ++++++++++++++++++++++++++------ runtime/lua/vim/_meta/api_keysets.lua | 12 ++++++++++++ 2 files changed, 38 insertions(+), 6 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index d799446647..64c67be076 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -12,12 +12,6 @@ vim.api = {} --- @return string function vim.api.nvim__buf_debug_extmarks(buffer, keys, dot) end ---- @private ---- @param buffer integer ---- @param first integer ---- @param last integer -function vim.api.nvim__buf_redraw_range(buffer, first, last) end - --- @private --- @param buffer integer --- @return table @@ -105,6 +99,32 @@ function vim.api.nvim__inspect_cell(grid, row, col) end --- function vim.api.nvim__invalidate_glyph_cache() end +--- @private +--- EXPERIMENTAL: this API may change in the future. +--- +--- Instruct Nvim to redraw various components. +--- +--- @param opts vim.api.keyset.redraw 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'. +function vim.api.nvim__redraw(opts) end + --- @private --- @return any[] function vim.api.nvim__runtime_inspect() end diff --git a/runtime/lua/vim/_meta/api_keysets.lua b/runtime/lua/vim/_meta/api_keysets.lua index 9f9ade3e76..f7cd92a3b2 100644 --- a/runtime/lua/vim/_meta/api_keysets.lua +++ b/runtime/lua/vim/_meta/api_keysets.lua @@ -207,6 +207,18 @@ error('Cannot require a meta file') --- @field buf? integer --- @field filetype? string +--- @class vim.api.keyset.redraw +--- @field flush? boolean +--- @field cursor? boolean +--- @field valid? boolean +--- @field statuscolumn? boolean +--- @field statusline? boolean +--- @field tabline? boolean +--- @field winbar? boolean +--- @field range? any[] +--- @field win? integer +--- @field buf? integer + --- @class vim.api.keyset.runtime --- @field is_lua? boolean --- @field do_source? boolean -- cgit From e948d7feba240568b1c0ab9bcb37cc264666a67d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 4 May 2024 15:53:42 +0800 Subject: vim-patch:ad4881cb3c04 (#28636) runtime(doc): correct getscriptinfo() example (vim/vim#14718) When "sid" is specified, it returns a List with a single item. https://github.com/vim/vim/commit/ad4881cb3c04048242f69dc77af2dde889c9beea --- runtime/lua/vim/_meta/vimfn.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 74b8590924..6674bbf82d 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -3628,7 +3628,7 @@ function vim.fn.getregtype(regname) end --- --- Examples: >vim --- echo getscriptinfo({'name': 'myscript'}) ---- echo getscriptinfo({'sid': 15}).variables +--- echo getscriptinfo({'sid': 15})[0].variables --- < --- --- @param opts? table -- cgit From efb44e0cad294f51e330d57d7590d38de5cec62c Mon Sep 17 00:00:00 2001 From: Maria José Solano Date: Sat, 4 May 2024 15:08:17 -0700 Subject: docs: fix lua type warnings (#28633) --- runtime/lua/vim/_meta/api_keysets_extra.lua | 2 +- runtime/lua/vim/_meta/builtin_types.lua | 8 ++++++++ runtime/lua/vim/_meta/vimfn.lua | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api_keysets_extra.lua b/runtime/lua/vim/_meta/api_keysets_extra.lua index d61dd2c02f..76b56b04e7 100644 --- a/runtime/lua/vim/_meta/api_keysets_extra.lua +++ b/runtime/lua/vim/_meta/api_keysets_extra.lua @@ -124,7 +124,7 @@ error('Cannot require a meta file') --- @field commalist boolean --- @field flaglist boolean --- @field was_set boolean ---- @field last_set_id integer +--- @field last_set_sid integer --- @field last_set_linenr integer --- @field last_set_chan integer --- @field type 'string'|'boolean'|'number' diff --git a/runtime/lua/vim/_meta/builtin_types.lua b/runtime/lua/vim/_meta/builtin_types.lua index 0bbc3e9bc8..9f0d2e7038 100644 --- a/runtime/lua/vim/_meta/builtin_types.lua +++ b/runtime/lua/vim/_meta/builtin_types.lua @@ -127,3 +127,11 @@ --- @field skipcol integer --- @field topfill integer --- @field topline integer + +--- @class vim.fn.getscriptinfo.ret +--- @field autoload false +--- @field functions? string[] +--- @field name string +--- @field sid string +--- @field variables? table +--- @field version 1 diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 6674bbf82d..dc25b0dd40 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -3632,7 +3632,7 @@ function vim.fn.getregtype(regname) end --- < --- --- @param opts? table ---- @return any +--- @return vim.fn.getscriptinfo.ret[] function vim.fn.getscriptinfo(opts) end --- If {tabnr} is not specified, then information about all the -- cgit From 8f0a166da4cd919947ef1ed634d350ef602acc63 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 20 Apr 2024 23:21:08 +0200 Subject: refactor(api): rename nvim_win_remove_ns Problem: nvim_win_remove_ns does not follow `help dev-naming` API naming conventions. Solution: Rename it. --- runtime/lua/vim/_meta/api.lua | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index 64c67be076..dbd3c61634 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -656,8 +656,8 @@ function vim.api.nvim_buf_line_count(buffer) end --- • url: A URL to associate with this extmark. In the TUI, the --- OSC 8 control sequence is used to generate a clickable --- hyperlink to this URL. ---- • scoped: boolean that indicates that the extmark should only ---- be displayed in the namespace scope. (experimental) +--- • scoped: boolean (EXPERIMENTAL) enables "scoping" for the +--- extmark. See `nvim_win_add_ns()` --- @return integer function vim.api.nvim_buf_set_extmark(buffer, ns_id, line, col, opts) end @@ -2114,10 +2114,11 @@ function vim.api.nvim_tabpage_set_var(tabpage, name, value) end --- @param win integer Window handle, must already belong to {tabpage} function vim.api.nvim_tabpage_set_win(tabpage, win) end ---- Adds the namespace scope to the window. +--- Scopes a namespace to the a window, so extmarks in the namespace will be +--- active only in the given window. --- --- @param window integer Window handle, or 0 for current window ---- @param ns_id integer the namespace to add +--- @param ns_id integer Namespace --- @return boolean function vim.api.nvim_win_add_ns(window, ns_id) end @@ -2137,6 +2138,13 @@ function vim.api.nvim_win_call(window, fun) end --- hidden, even if 'hidden' is not set. function vim.api.nvim_win_close(window, force) end +--- Unscopes a namespace (un-binds it from the given scope). +--- +--- @param window integer Window handle, or 0 for current window +--- @param ns_id integer the namespace to remove +--- @return boolean +function vim.api.nvim_win_del_ns(window, ns_id) end + --- Removes a window-scoped (w:) variable --- --- @param window integer Window handle, or 0 for current window @@ -2173,7 +2181,7 @@ function vim.api.nvim_win_get_cursor(window) end --- @return integer function vim.api.nvim_win_get_height(window) end ---- Gets all the namespaces scopes associated with a window. +--- Gets the namespace scopes for a given window. --- --- @param window integer Window handle, or 0 for current window --- @return integer[] @@ -2232,13 +2240,6 @@ function vim.api.nvim_win_hide(window) end --- @return boolean function vim.api.nvim_win_is_valid(window) end ---- Removes the namespace scope from the window. ---- ---- @param window integer Window handle, or 0 for current window ---- @param ns_id integer the namespace to remove ---- @return boolean -function vim.api.nvim_win_remove_ns(window, ns_id) end - --- Sets the current buffer in a window, without side effects --- --- @param window integer Window handle, or 0 for current window -- cgit From 97c7646501d5cd6f57c57ce30acca89c5b8573ff Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 12 May 2024 23:12:25 +0200 Subject: refactor(api): nvim_win_xx_ns are EXPERIMENTAL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: The nvim_win_xx_ns function family introduced in ba0370b1d718d473d0ef51c35d88b98ba220082b needs more bake-time. Currently it's narrowly defined for windows, but other scopes ("buffer") and features are likely in the future. Solution: - Rename the API with double-underscore to mark it as EXPERIMENTAL. TODO/FUTURE: - Rename and change the signature to support more than just "window" scope, and for other flexibility. - Open question: we could choose either: - "store scopes on namespaces", or - "store namespaces on scopes (w:/b:/…)" --- runtime/lua/vim/_meta/api.lua | 53 +++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index dbd3c61634..6edf2a5a96 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -144,6 +144,36 @@ function vim.api.nvim__stats() end --- @return any function vim.api.nvim__unpack(str) end +--- @private +--- EXPERIMENTAL: this API will change in the future. +--- +--- Scopes a namespace to the a window, so extmarks in the namespace will be +--- active only in the given window. +--- +--- @param window integer Window handle, or 0 for current window +--- @param ns_id integer Namespace +--- @return boolean +function vim.api.nvim__win_add_ns(window, ns_id) end + +--- @private +--- EXPERIMENTAL: this API will change in the future. +--- +--- Unscopes a namespace (un-binds it from the given scope). +--- +--- @param window integer Window handle, or 0 for current window +--- @param ns_id integer the namespace to remove +--- @return boolean +function vim.api.nvim__win_del_ns(window, ns_id) end + +--- @private +--- EXPERIMENTAL: this API will change in the future. +--- +--- Gets the namespace scopes for a given window. +--- +--- @param window integer Window handle, or 0 for current window +--- @return integer[] +function vim.api.nvim__win_get_ns(window) end + --- Adds a highlight to buffer. --- --- Useful for plugins that dynamically generate highlights to a buffer (like @@ -657,7 +687,7 @@ function vim.api.nvim_buf_line_count(buffer) end --- OSC 8 control sequence is used to generate a clickable --- hyperlink to this URL. --- • scoped: boolean (EXPERIMENTAL) enables "scoping" for the ---- extmark. See `nvim_win_add_ns()` +--- extmark. See `nvim__win_add_ns()` --- @return integer function vim.api.nvim_buf_set_extmark(buffer, ns_id, line, col, opts) end @@ -2114,14 +2144,6 @@ function vim.api.nvim_tabpage_set_var(tabpage, name, value) end --- @param win integer Window handle, must already belong to {tabpage} function vim.api.nvim_tabpage_set_win(tabpage, win) end ---- Scopes a namespace to the a window, so extmarks in the namespace will be ---- active only in the given window. ---- ---- @param window integer Window handle, or 0 for current window ---- @param ns_id integer Namespace ---- @return boolean -function vim.api.nvim_win_add_ns(window, ns_id) end - --- Calls a function with window as temporary current window. --- --- @param window integer Window handle, or 0 for current window @@ -2138,13 +2160,6 @@ function vim.api.nvim_win_call(window, fun) end --- hidden, even if 'hidden' is not set. function vim.api.nvim_win_close(window, force) end ---- Unscopes a namespace (un-binds it from the given scope). ---- ---- @param window integer Window handle, or 0 for current window ---- @param ns_id integer the namespace to remove ---- @return boolean -function vim.api.nvim_win_del_ns(window, ns_id) end - --- Removes a window-scoped (w:) variable --- --- @param window integer Window handle, or 0 for current window @@ -2181,12 +2196,6 @@ function vim.api.nvim_win_get_cursor(window) end --- @return integer function vim.api.nvim_win_get_height(window) end ---- Gets the namespace scopes for a given window. ---- ---- @param window integer Window handle, or 0 for current window ---- @return integer[] -function vim.api.nvim_win_get_ns(window) end - --- Gets the window number --- --- @param window integer Window handle, or 0 for current window -- cgit From 01b6bff7e9bc751be20ce7bb68e7ebe3037441de Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 2 May 2024 15:57:21 +0200 Subject: docs: news Set dev_xx.txt help files to use "flow" layout. --- runtime/lua/vim/_meta/lpeg.lua | 7 +++---- runtime/lua/vim/_meta/re.lua | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'runtime/lua/vim/_meta') diff --git a/runtime/lua/vim/_meta/lpeg.lua b/runtime/lua/vim/_meta/lpeg.lua index 1ce40f3340..73b3375c82 100644 --- a/runtime/lua/vim/_meta/lpeg.lua +++ b/runtime/lua/vim/_meta/lpeg.lua @@ -6,11 +6,10 @@ error('Cannot require a meta file') -- with types being renamed to include the vim namespace and with some descriptions made less verbose. --- @brief
help
---- LPeg is a pattern-matching library for Lua, based on
---- Parsing Expression Grammars (https://bford.info/packrat/) (PEGs).
+--- LPeg is a pattern-matching library for Lua, based on Parsing Expression
+--- Grammars (PEGs). https://bford.info/packrat/
 ---
----                                                                     *lua-lpeg*
----                                                             *vim.lpeg.Pattern*
+---                                                  *lua-lpeg* *vim.lpeg.Pattern*
 --- The LPeg library for parsing expression grammars is included as `vim.lpeg`
 --- (https://www.inf.puc-rio.br/~roberto/lpeg/).
 ---
diff --git a/runtime/lua/vim/_meta/re.lua b/runtime/lua/vim/_meta/re.lua
index 9721e6f8c8..d16751fbbf 100644
--- a/runtime/lua/vim/_meta/re.lua
+++ b/runtime/lua/vim/_meta/re.lua
@@ -8,11 +8,11 @@ error('Cannot require a meta file')
 -- See 'lpeg.html' for license
 
 --- @brief
---- The `vim.re` module provides a conventional regex-like syntax for pattern usage
---- within LPeg |vim.lpeg|.
+--- The `vim.re` module provides a conventional regex-like syntax for pattern usage within LPeg
+--- |vim.lpeg|. (Unrelated to |vim.regex| which provides Vim |regexp| from Lua.)
 ---
---- See https://www.inf.puc-rio.br/~roberto/lpeg/re.html for the original
---- documentation including regex syntax and more concrete examples.
+--- See https://www.inf.puc-rio.br/~roberto/lpeg/re.html for the original documentation including
+--- regex syntax and examples.
 
 --- Compiles the given {string} and returns an equivalent LPeg pattern. The given string may define
 --- either an expression or a grammar. The optional {defs} table provides extra Lua values to be used
-- 
cgit 


From 618e34ca095739935ac436fec58bb2a223ea3dc1 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Thu, 16 May 2024 14:29:56 +0800
Subject: vim-patch:5faeb60480c6 (#28768)

runtime(doc): clarify {special} argument for shellescape()

closes: vim/vim#14770

https://github.com/vim/vim/commit/5faeb60480c6efba5c0468c01275120b6ace5a09

N/A patch:
vim-patch:c0e038b59f84

Co-authored-by: Enno 
---
 runtime/lua/vim/_meta/vimfn.lua | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'runtime/lua/vim/_meta')

diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index dc25b0dd40..853f354275 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -8293,10 +8293,11 @@ function vim.fn.sha256(string) end
 --- Otherwise encloses {string} in single-quotes and replaces all
 --- "'" with "'\''".
 ---
---- If {special} is a |non-zero-arg|:
---- - Special items such as "!", "%", "#" and "" will be
----   preceded by a backslash. The backslash will be removed again
----   by the |:!| command.
+--- The {special} argument adds additional escaping of keywords
+--- used in Vim commands. If it is a |non-zero-arg|:
+--- - Special items such as "!", "%", "#" and "" (as listed
+---   in |expand()|) will be preceded by a backslash.
+---   The backslash will be removed again by the |:!| command.
 --- - The  character is escaped.
 ---
 --- If 'shell' contains "csh" in the tail:
-- 
cgit 


From d89144626e7429d9c499875ed426a6223f9013be Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Mon, 20 May 2024 06:15:58 +0800
Subject: vim-patch:9.1.0394: Cannot get a list of positions describing a
 region

Problem:  Cannot get a list of positions describing a region
          (Justin M. Keyes, after v9.1.0120)
Solution: Add the getregionpos() function
          (Shougo Matsushita)

fixes: vim/vim#14609
closes: vim/vim#14617

https://github.com/vim/vim/commit/b4757e627e6c83d1c8e5535d4887a82d6a5efdd0

Co-authored-by: Shougo Matsushita 
Co-authored-by: Justin M. Keyes 
---
 runtime/lua/vim/_meta/vimfn.lua | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

(limited to 'runtime/lua/vim/_meta')

diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index 853f354275..fbcdd52116 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -3581,6 +3581,28 @@ function vim.fn.getreginfo(regname) end
 --- @return string[]
 function vim.fn.getregion(pos1, pos2, opts) end
 
+--- Same as |getregion()|, but returns a list of positions
+--- describing the buffer text segments bound by {pos1} and
+--- {pos2}.
+--- The segments are a pair of positions for every line: >
+---   [[{start_pos}, {end_pos}], ...]
+--- <
+--- The position is a |List| with four numbers:
+---     [bufnum, lnum, col, off]
+--- "bufnum" is the buffer number.
+--- "lnum" and "col" are the position in the buffer.  The first
+--- column is 1.
+--- The "off" number is zero, unless 'virtualedit' is used.  Then
+--- it is the offset in screen columns from the start of the
+--- character.  E.g., a position within a  or after the last
+--- character.
+---
+--- @param pos1 table
+--- @param pos2 table
+--- @param opts? table
+--- @return integer[][][]
+function vim.fn.getregionpos(pos1, pos2, opts) end
+
 --- The result is a String, which is type of register {regname}.
 --- The value will be one of:
 ---     "v"      for |charwise| text
-- 
cgit 


From e0259b9466a0dd62b74d4aa195b3c5e6c7a183d0 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Mon, 20 May 2024 20:50:32 +0800
Subject: vim-patch:9.1.0423: getregionpos() wrong with blockwise mode and
 multibyte

Problem:  getregionpos() wrong with blockwise mode and multibyte.
Solution: Use textcol and textlen instead of start_vcol and end_vcol.
          Handle coladd properly (zeertzjq).

Also remove unnecessary buflist_findnr() in add_regionpos_range(), as
getregionpos() has already switched buffer.

closes: vim/vim#14805

https://github.com/vim/vim/commit/c95e64f41f7f6d1bdc95b047ae9b369743c8637b
---
 runtime/lua/vim/_meta/vimfn.lua | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'runtime/lua/vim/_meta')

diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index fbcdd52116..dee65a40c7 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -3592,10 +3592,12 @@ function vim.fn.getregion(pos1, pos2, opts) end
 --- "bufnum" is the buffer number.
 --- "lnum" and "col" are the position in the buffer.  The first
 --- column is 1.
---- The "off" number is zero, unless 'virtualedit' is used.  Then
---- it is the offset in screen columns from the start of the
---- character.  E.g., a position within a  or after the last
---- character.
+--- If the "off" number of a starting position is non-zero, it is
+--- the offset in screen columns from the start of the character.
+--- E.g., a position within a  or after the last character.
+--- If the "off" number of an ending position is non-zero, it is
+--- the character's number of cells included in the selection,
+--- otherwise the whole character is included.
 ---
 --- @param pos1 table
 --- @param pos2 table
-- 
cgit 


From 5cbd6d9b9f232a6ff22ae3a9af80075404226e4b Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Thu, 23 May 2024 06:08:24 +0800
Subject: vim-patch:9.1.0430: getregionpos() doesn't handle one char selection
 (#28924)

Problem:  getregionpos() doesn't handle one char selection.
Solution: Handle startspaces differently when is_oneChar is set.
          Also add a test for an exclusive charwise selection with
          multibyte chars (zeertzjq)

closes: vim/vim#14825

https://github.com/vim/vim/commit/52a6f348874778cf315b47d9e8b5f818f4b97277
---
 runtime/lua/vim/_meta/vimfn.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/lua/vim/_meta')

diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index dee65a40c7..e00b2e6acd 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -3596,8 +3596,8 @@ function vim.fn.getregion(pos1, pos2, opts) end
 --- the offset in screen columns from the start of the character.
 --- E.g., a position within a  or after the last character.
 --- If the "off" number of an ending position is non-zero, it is
---- the character's number of cells included in the selection,
---- otherwise the whole character is included.
+--- the offset of the character's first cell not included in the
+--- selection, otherwise all its cells are included.
 ---
 --- @param pos1 table
 --- @param pos2 table
-- 
cgit 


From cd05fbef170b29083973fd11170d25225feb8bed Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Fri, 24 May 2024 15:44:52 +0800
Subject: vim-patch:9.1.0441: getregionpos() can't properly indicate positions
 beyond eol (#28957)

Problem:  getregionpos() can't properly indicate positions beyond eol.
Solution: Add an "eol" flag that enables handling positions beyond end
          of line like getpos() does (zeertzjq).

Also fix the problem that a position still has the coladd beyond the end
of the line when its column has been clamped.  In the last test case
with TABs at the end of the line the old behavior is obviously wrong.

I decided to gate this behind a flag because returning positions that
don't correspond to actual characters in the line may lead to mistakes
for callers that want to calculate the length of the selected text, so
the behavior is only enabled if the caller wants it.

closes: vim/vim#14838

https://github.com/vim/vim/commit/2b09de910458247b70751928217422c38fd5abf8
---
 runtime/lua/vim/_meta/vimfn.lua | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'runtime/lua/vim/_meta')

diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
index e00b2e6acd..f4daacfb7d 100644
--- a/runtime/lua/vim/_meta/vimfn.lua
+++ b/runtime/lua/vim/_meta/vimfn.lua
@@ -3599,6 +3599,19 @@ function vim.fn.getregion(pos1, pos2, opts) end
 --- the offset of the character's first cell not included in the
 --- selection, otherwise all its cells are included.
 ---
+--- Apart from the options supported by |getregion()|, {opts} also
+--- supports the following:
+---
+---   eol    If |TRUE|, indicate positions beyond
+---       the end of a line with "col" values
+---       one more than the length of the line.
+---       If |FALSE|, positions are limited
+---       within their lines, and if a line is
+---       empty or the selection is entirely
+---       beyond the end of a line, a "col"
+---       value of 0 is used for both positions.
+---       (default: |FALSE|)
+---
 --- @param pos1 table
 --- @param pos2 table
 --- @param opts? table
-- 
cgit 


From a616272f568a9492580abfd22ab460457ecdbfa3 Mon Sep 17 00:00:00 2001
From: Famiu Haque 
Date: Fri, 24 May 2024 15:57:46 +0600
Subject: feat(complete): specify reason for CompleteDone

Problem: `CompleteDone` currently does not specify the reason for why completion was done, which is problematic for completion plugins as they cannot know whether the event was triggered due to the completion being canceled, accepted, or for some other reason.

Solution: Add a `reason` key to `v:event`, which is set by `CompleteDone` to indicate why completion ended.
---
 runtime/lua/vim/_meta/vvars.lua | 1 +
 1 file changed, 1 insertion(+)

(limited to 'runtime/lua/vim/_meta')

diff --git a/runtime/lua/vim/_meta/vvars.lua b/runtime/lua/vim/_meta/vvars.lua
index 1660d1dd6c..e00402ab3f 100644
--- a/runtime/lua/vim/_meta/vvars.lua
+++ b/runtime/lua/vim/_meta/vvars.lua
@@ -195,6 +195,7 @@ vim.v.errors = ...
 ---   changed_window   Is `v:true` if the event fired while
 ---                    changing window  (or tab) on `DirChanged`.
 ---   status           Job status or exit code, -1 means "unknown". `TermClose`
+---   reason           Reason for completion being done. `CompleteDone`
 --- @type any
 vim.v.event = ...
 
-- 
cgit