aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta
Commit message (Collapse)AuthorAge
...
* fix(defaults): detect `'background'`/`'termguicolors'` on UI attach #40175Barrett Ruth2026-06-20
| | | | | | | | Problem: Terminal background and truecolor detection runs only at startup, gated on a UI being attached. A headless server has no UI then, so `'background'` and `'termguicolors'` are never detected and remote UIs ignore the terminal's theme. Solution: Also (re)detect on UIEnter. The most recently attached terminal wins; an explicit user value is preserved.
* feat(column): per row click handlers for 'statuscolumn' (#40265)luukvbaal2026-06-20
| | | | | | | | | | | | | | Problem: - Current 'statuscolumn' click label caveat is restrictive. - v:virtnum is not unique to a line if it has both above and below virtual lines. - 'statuscolumn' click handler may expect v:virt/lnum to be set. Solution: - Store per-row click definitions for the statuscolumn in a (nested line/virt number) map. - Implement strategy that gives each 'statuscolumn' row a unique v:virtnum. - Set v:virt/lnum when determining which line is clicked.
* feat(:restart): v:startreason #40186Nathan Zeng2026-06-18
| | | | | | | | Problem: It's clumsy for scripts to handle a "restart", without custom mappings or global vars. Solution: Introduce `v:startreason`
* fix(api): keep highlight font through set/get and redraws #40200glepnir2026-06-15
| | | | | | | | | | | | Problem: a font set via nvim_set_hl is lost or corrupted with font-only groups, attribute combining, and update=true, and is dropped on any attr-table rebuild. nvim__inspect_cell also frees the font name while a returned dict still borrows it. Solution: register font-only groups, carry font through hl_combine_attr, inherit it on update, and persist sg_font so a rebuild can restore it. Keep interned font names across a rebuild instead of clearing them. Add the missing font field to get_hl_info. Co-authored-by: Ryan Patterson <cgamesplay@cgamesplay.com>
* feat(events): :mksession SessionWritePre event #39688Igor Lacerda2026-06-14
| | | | | | | Problem: No event triggered just before writing a session file. Solution: Add `SessionWritePre`.
* vim-patch:9.2.0624: C-N/C-P cannot be mapped in complete() completion (#40232)glepnir2026-06-14
| | | | | | | | | | | | | | | | Problem: Keys valid in CTRL-X mode are never mapped while insert completion is active, so <C-N> and <C-P> cannot be remapped for completion started by complete(). Solution: Do not disable mappings in CTRL_X_EVAL mode. In this mode a mapping cannot interfere with selecting the completion method, which is what the no-mapping rule exists for. related: vim/vim#6440 related: vim/vim#16880 closes: vim/vim#20489 https://github.com/vim/vim/commit/076585e6addb5688f123ef3e174fcfee993b7602 Co-authored-by: Thomas M Kehrenberg <tmke8@posteo.net>
* test(autoread): cleanupJustin M. Keyes2026-06-13
| | | | | | - Merged into the main "reloads on external change" test. - Reduce duplication. - Wall-clock down from ~4.4s to ~1.4s (dropped 3s debounce test).
* feat(autoread): use filewatchers for OS-driven change detection #37971Oleksandr Chekhovskyi2026-06-12
| | | | | | | | | | | | | | | Problem: The 'autoread' option only checks for file changes reactively — on FocusGained, :checktime, CmdlineEnter, etc. — by polling timestamps. External changes are not detected until the user interacts with Neovim. Solution: Add a core module (runtime/lua/nvim/autoread.lua) enabled from runtime/plugin/autoread.lua that watches each buffer's file using vim._watch.watch() (libuv fs_event). On change detection it calls :checktime, which invokes the existing buf_check_timestamp() logic for reload/prompt handling. Watchers are managed via autocmds tied to buffer lifecycle events and respect the 'autoread' option (global and buffer-local).
* docs: miscJustin M. Keyes2026-06-11
|
* fix(option): set 'shell…' options based on detected shell #40031tao2026-06-10
| | | | | | | | | | | | | | | | | | Problem: * 'shellcmdflag' states that its default value is set according to the value of 'shell', but this behavior is not yet implemented on Windows. The same applies to 'shellpipe', 'shellredir', and 'shellxquote'. * On Windows, Git is often installed in paths containing spaces, and we still do not correctly resolve the sh executable name as described in 'shell'. * On Windows, the default value of 'shellslash' is always `false`, which causes Unix-like shells to interpret `\` in paths returned by some functions as escape charaters. Solution: Use a simple rule table to detect common shells (e.g. `cmd`, `powershell`, shells whose names contain `csh` or `sh`) and apply best-effort defaults, while leaving more complex scenarios to user configuration.
* vim-patch:595d0a7: runtime(doc): wrong {str} length limit in matchfuzzy() ↵zeertzjq2026-06-10
| | | | | | | | | | | | | docs (#40157) Problem: docs say {str} is capped at 256 and longer returns an empty list. Solution: it's 1024, and {str} plus each candidate are just truncated to that, not rejected; fix the text. closes: vim/vim#20453 https://github.com/vim/vim/commit/595d0a77e48d02d2865e05d8ea89aa169166b987 Co-authored-by: glepnir <glephunter@gmail.com>
* docs: misc #40126Justin M. Keyes2026-06-08
|
* feat(extmark): virt_lines_overflow "wrap" and "auto"jreidx2026-06-08
| | | | | | Problem: Extmark has support for horizontal scrolling and truncating, but not wrapping. Solution: Extend virt_lines_overflow flags to support "wrap" and "auto" based on proposed changes in #18282.
* vim-patch:9.2.0596: cmdline completion popup cannot be scrolled with the ↵zeertzjq2026-06-08
| | | | | | | | | | | | | | | | | | | mouse (#40142) Problem: In command-line completion with a popup menu ('wildoptions' contains "pum"), the info popup shown next to the menu could not be scrolled, unlike the Insert mode completion info popup which scrolls with the mouse wheel. Solution: When the mouse pointer is on top of the info popup, scroll it with the mouse wheel in command-line mode as well, without closing the completion popup menu. closes: vim/vim#20146 closes: vim/vim#20418 https://github.com/vim/vim/commit/96dbab257a881ee4a552e1acf62e7d4168dc444a Co-authored-by: Hirohito Higashi <h.east.727@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(option): allow empty/blank edges in 'winborder' #40112glepnir2026-06-05
| | | | | | | | | | Problem: The comma form of 'winborder' is split with copy_option_part(), whose skip_to_option_part() eats spaces after a comma, and empty fields are rejected. Solution: Split the comma form literally on ',', keeping empty fields and single-space fields.
* docs: misc, lspJustin M. Keyes2026-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: This doc on `vim.lsp.completion.get()`: --- Used by the default LSP |omnicompletion| provider |vim.lsp.omnifunc()|, thus |i_CTRL-X_CTRL-O| --- invokes this in LSP-enabled buffers. Use CTRL-Y to select an item from the completion menu. --- |complete_CTRL-Y| ...makes two wrong claims: 1. "Used by the default LSP omnicompletion provider vim.lsp.omnifunc()" - `_omnifunc` does not call `M.get()`, it calls the internal `trigger()` directly. 2. "thus |i_CTRL-X_CTRL-O| invokes this in LSP-enabled buffers" - The two paths use different client sets: - `M.get()` reads `buf_handles[bufnr].clients` (clients explicitly registered via `vim.lsp.completion.enable(true, ...)`). - `_omnifunc` reads `lsp.get_clients({method='textDocument/completion'})` (every completion client, regardless of `enable()`). Solution: Update docs. Co-authored-by: Koichi Shiraishi <zchee.io@gmail.com> Co-authored-by: y9san9 / Alex Sokol <y9san9@gmail.com> Co-authored-by: adv0r <>
* Merge #40057 from luukvbaal/hidenodrawJustin M. Keyes2026-06-02
|\ | | | | perf(redraw): don't redraw hidden windows
| * perf(redraw): don't redraw hidden windowsLuuk van Baal2026-05-31
| | | | | | | | | | Problem: Hidden windows are redrawn unnecessarily. Solution: If a window is hidden, don't bother drawing it.
* | vim-patch:partial:9.2.0573: Vim9: missing EX_WHOLE on some block keywords ↵zeertzjq2026-06-01
|/ | | | | | | | | | | | | | | | | | | | | | | (#40071) Problem: Several Vim9 keywords lack EX_WHOLE and can be shortened in Vim9 script, inconsistent with endif/enddef/endfor/endwhile/ endtry which already have it. The error from :endd in a nested function also hardcodes "enddef" instead of reporting what the user typed. fullcommand("ho") returns "horizontal" even though :ho is below the documented 3-char minimum. Solution: Add EX_WHOLE to :class, :def, :endclass, :endinterface, :endenum, :public and :static. In get_function_body() pass the user-typed command to the error message. Force :ho to CMD_SIZE in find_ex_command() so fullcommand() reflects the modifier minimum. Extend tests and documentation accordingly (Peter Kenny). fixes: vim/vim#20032 closes: vim/vim#20191 https://github.com/vim/vim/commit/38d9a16eba8cdf3377e8b867da805bf369454108 Co-authored-by: Peter Kenny <github.com@k1w1.cyou>
* docs: misc, options, pos/rangeJustin M. Keyes2026-05-30
|
* vim-patch:9.2.0538: Cannot keep leading whitespace in %{} statusline expr ↵zeertzjq2026-05-26
| | | | | | | | | | | | | | | (#40007) Problem: A leading space in the result of a %{} item is sometimes stripped, and an all-digit result is converted to a number. Solution: Add %0{} atom which inserts the expression result verbatim (glepnir) fixes: vim/vim#3898 closes: vim/vim#20315 https://github.com/vim/vim/commit/e8d7a40b98ce4062834399f097216213a0088ff3 Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:c7645fc: runtime(doc): add a few references to mouse behaviour ↵zeertzjq2026-05-23
| | | | | | | | | (#39959) fixes: vim/vim#20281 https://github.com/vim/vim/commit/c7645fcda50f95cc098545b70ce937a986b997d1 Co-authored-by: Christian Brabandt <cb@256bit.org>
* refactor(docs): generate tui.txt $NVIM_TERMDEFS keys #39836Kyle2026-05-21
| | | | | | | | | Problem: Potential documentation drift in `tui.txt` if fields for `$NVIM_TERMDEFS` change. Solution: Generate docs for `tui.txt`. Add `brief_xform` to `gen_vimdoc.lua` to allow transforming briefs during generation.
* docs: misc, custom text-object #39877Justin M. Keyes2026-05-20
| | | | | text-object-define is a pattern I found in tpope's plugins (e.g. https://github.com/tpope/vim-jdaddy) which shows an elegant way to define a text-object. (Any mistakes in the example are my fault.)
* fix(api): nvim_exec_autocmds({buf=x}) runs in buffer context #39061Barrett Ruth2026-05-20
| | | | | Problem: `nvim_exec_autocmds({ buf = ... })` matches the target buffer, but callbacks and modelines run with the caller buffer current rather than the target buffer. Solution: Execute the buffered path in prepared target-buffer context and restore the caller afterward.
* fix(startup): emitting useless OptionSet #39830Puneet Dixit2026-05-17
| | | | | | | | | | | Problem: During startup, we manually trigger a useless and misleading `OptionSet` event, which doesn't set `v:option_*` values (this is a limitation of `nvim_exec_autocmds`). https://github.com/neovim/neovim/blob/ad4bc2d90c5109c24bf6f0119ad31276f1518c6f/runtime/lua/vim/_core/defaults.lua#L939. Solution: The `nvim_exec_autocmds('OptionSet',…)` call does not serve any purpose since 5cbb9d613bf6d8983b5effd7e20343a4ef497c06, so just drop it.
* refactor: group nvim_buf_call, nvim_win_call tests #39828Justin M. Keyes2026-05-17
|
* feat(api): nvim_buf_call, win_call can has multiple return values #39801bfredl2026-05-17
| | | | | | from the "because we can and it is not much code" department. (diffcount excluding tests is actually negative) fixes https://github.com/neovim/neovim/issues/39636#issuecomment-4397141270
* feat(api): tab-local option scope #39811Justin M. Keyes2026-05-17
| | | | | | | | | | | | | | | | | | Problem: 2d795face6e4 added support for tab-local options ('cmdheight') to `nvim_get_option_value`, but not to: nvim_get_option_info2() nvim_set_option_value(…, { tab = … }) gettabwinvar() Solution: - Update `options.lua` to model tab-local options. Introduce `kOptScopeTab`. - Handle tab scope in the options layer so it works for all options APIs. Note: - No change to `gettabvar()`. Not sure if needed/wanted. fix https://github.com/neovim/neovim/issues/31140
* feat(events): add TabMoved autocommand event #24137yashlala2026-05-16
| | | | | | | | | | Problem: No way to handle a "tab moved" event. Use-case: tabline plugins may cache tab labels, and need to know when to invalidate their cache. Solution: Add a `TabMoved` event that triggers whenever tabs are reordered via `:tabmove` or via mouse click-and-drag.
* feat(prompt): support 'scrollback' option in prompt-buffers #39793Tomas Slusny2026-05-16
| | | | | | | | | | | | | | Problem: There is a lot of overlap between terminal and prompt buffer, but no easy way to limit the number of lines kept above the prompt to prevent performance and other issues. This is desirable for both example use cases in current documentation, chat UI and repl/shell plugins. Solution: Use existing 'scrollback' option to limit prompt-buffer lines as well. Signed-off-by: Tomas Slusny <slusnucky@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(api): nvim_get_option_value tab-local 'cmdheight' #39259EliWiegman2026-05-16
| | | | | | | Problem: API clients cannot query the tab-local value of 'cmdheight'. Solution: Allow nvim_get_option_value() to accept { tab = <tab-ID> } for 'cmdheight'.
* docs: dev, lsp, indent-guides #39756Justin M. Keyes2026-05-14
| | | | | | | - document "indent guides" https://github.com/neovim/neovim/issues/39726 - document guidance for "subcommands" https://github.com/neovim/neovim/issues/32263#issuecomment-4436002808 Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: Noa Levi <275430404+lphuc2250gma@users.noreply.github.com>
* vim-patch:9.2.0470: No way to hook into put commandszeertzjq2026-05-13
| | | | | | | | | | | | | | Problem: No way to hook into put commands (yochem) Solution: Introduce TextPutPre and TextPutPost autocommands (Foxe Chen). fixes: vim/vim#18701 closes: vim/vim#20144 https://github.com/vim/vim/commit/e0781bd5bfd1acc2c4d5d01ec60fecafc99ee3e2 Co-authored-by: Foxe Chen <chen.foxe@gmail.com>
* feat(ui_client): "press ENTER" free nvim crash debuggingbfredl2026-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature might be a little silly and niche, but it is very useful for _my_ workflow (and open source is about mee) An issue which is never present on high quality RELEASE builds, but might occur on Debug builds is that the Nvim server crashes on some error in your unfinished PR code. If you compile your debug builds with sanitizers enabled, as you should, the ASAN/UBSAN runtime will print some useful info about your mistake to stderr or a log file, such as a stack trace. This can be used to jump to the error in the code. This allows the nvim server to install a signal hander in the ui client, which can load this log file in a good safe version of nvim and parse it using 'errorformat' This is inspired by the "press ENTER" free workflow of ui2 and applies it beyond the lifetime cycle of the nvim instance. example config: ```lua local asan = vim.env.ASAN_OPTIONS if asan ~= nil and string.match(asan, "log_path=/tmp/nvim_asan") then local myname = "/tmp/nvim_asan."..vim.uv.getpid() local args = {"--embed", "-n", "+set efm=%+A%*[^/]%f:%l:%c", "+silent cfile "..myname, "+silent cfirst", "+silent copen"} vim.api.nvim__set_restart_on_crash("nvim", args) end ``` and run your debug nvim like so ASAN_OPTIONS=handle_abort=1,handle_sigill=1,log_path=/tmp/nvim_asan ./build/bin/nvim
* docs: misc, window #39720Justin M. Keyes2026-05-10
| | | | - formalize `window-number` similar to `tabpage-number`. - reference it from docs.
* vim-patch:9.2.0458: Crash with invalid shellredir/shellpipe value (#39691)zeertzjq2026-05-09
| | | | | | | | | | | | Problem: Crash with invalid shellredir/shellpipe value (bfredl) Solution: Validate the option and allow only a single "%s". fixes: vim/vim#20157 closes: vim/vim#20159 https://github.com/vim/vim/commit/84ae09dd79b9888ba71dc2a28f9afcac3e7b8901 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.2.0455: 'findfunc' only allows extra info for cmdline completionzeertzjq2026-05-09
| | | | | | | | | | | | Problem: 'findfunc' only allows extra info for cmdline completion, not for actually finding files (Maxim Kim, after 9.2.0451). Solution: Handle returning a list of dicts when actually finding files. Also fix crash on NULL string (zeertzjq). fixes: vim/vim#20163 closes: vim/vim#20164 https://github.com/vim/vim/commit/9694ff58fe510bf3906a7b6817429e29d5975987
* vim-patch:9.2.0451: 'findfunc' can't return extra info for cmdline completionzeertzjq2026-05-09
| | | | | | | | | | | | Problem: 'findfunc' can't return extra info for cmdline completion (Maxim Kim). Solution: Handle 'findfunc' return value in cmdline completion like that of "customlist" functions (zeertzjq). fixes: vim/vim#20155 closes: vim/vim#20158 https://github.com/vim/vim/commit/58124789aaf98fd96cd94a738633fd652a5e079a
* refactor: _meta/builtin_types.lua => vimfn_types.lua #39658Justin M. Keyes2026-05-07
| | | | | | | | | Problem: `builtin_types.lua` seems to be about vimfn (aka "eval", aka "vimscript", …) specifically, whereas `builtin.lua` is about the Lua stdlib. Solution: Rename it to `vimfn_types.lua`, to align with `vimfn.gen.lua`.
* build(docs): lint more quasi-keysets #39654Justin M. Keyes2026-05-07
| | | | | | | | | Problem: Linter missed backtick and double-quote keynames in the quasi-keyset of the `nvim_create_user_command` docstring. Solution: Update the linter to check backtick-surrounded and quote-surrounded key names.
* feat(server): add v:useractive, use it in serverlist(info=true) #39423Szymon Wilczek2026-05-07
| | | | | | | | | | | | Problem: When showing the :connect menu, it is useful to know which servers are most-recently active. But we don't have a good way to detect that. Solution: - Introduce `v:useractive`. - Include this timestamp in `serverlist({info=true})`. Co-authored-by: Justin M. Keyes <justinkz@gmail.com> Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
* docs: expand nvim_create_user_command docs #39540Quentin2026-05-07
|
* docs: rename "tabpage"Justin M. Keyes2026-05-07
|
* docs: misc, rename "tabpage"Justin M. Keyes2026-05-07
| | | | | | Co-authored-by: michael-grunder <michael.grunder@gmail.com> Co-authored-by: Olivia Kinnear <git@superatomic.dev> Co-authored-by: Felipe Matarazzo <felipemps@protonmail.com>
* feat(server): serverlist({info=true}) gets detailed info #39392Szymon Wilczek2026-05-06
| | | | | | | | | | | | | | | | | Problem: UI tools and orchestration engines need more context than just raw socket addresses from serverlist(). Without knowing if a server belongs to the current instance or knowing its PID, UIs cannot display meaningful options to users. Solution: - Added the `info=v:true` option to `serverlist()`. - When `info` is requested, it implies `peer=true` and returns a list of dictionaries (defined as `vim.ServerInfo`) with `addr`, `pid` and `own`. - Uses an RPC request to `getpid()` across the socket to fetch the peer's actual process ID. Signed-off-by: Szymon Wilczek <swilczek.lx@gmail.com>
* feat(api): nvim_get_commands returns desc #39623glepnir2026-05-06
| | | | | | | | | Problem: Can't get a command's description from nvim_get_commands when cmd is string. Solution: Returns "desc" field in nvim_get_commands. `definition` is now empty when cmd is function type.
* vim-patch:bb807eb: runtime(doc): Tweak documentation style (#39597)zeertzjq2026-05-05
| | | | | | | closes: vim/vim#20134 https://github.com/vim/vim/commit/bb807ebc8a7a6ad3f3d330cf19ce775cb40a2811 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* vim-patch:9.2.0425: Cannot silence undo/redo messages (#39554)zeertzjq2026-05-02
| | | | | | | | | | | | Problem: Cannot silence undo/redo messages Solution: Add "u" flag to 'shortmess' option (Shougo Matsushita). fixes: vim/vim#20049 closes: vim/vim#20107 https://github.com/vim/vim/commit/d25f8d1b2c6e0cbd390a36884c95edc88f1b3d69 Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
* vim-patch:9.2.0417: completion: no support for "noinsert" with 'wildmode' ↵glepnir2026-04-30
| | | | | | | | | | | | | (#39516) Problem: completion: no support for "noinsert" with 'wildmode' and commandline completion Solution: Add "noinsert" value to the 'wildmode' option, mirroring 'completeopt' "noinsert" behaviour (glepnir). fixes: vim/vim#16551 closes: vim/vim#20080 https://github.com/vim/vim/commit/af494af5ff188d976073cbc049249614edffa4bf