aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
* Merge pull request #38675 from bfredl/errdeferbfredl2026-05-12
|\ | | | | feat(ui_client): "press ENTER" free nvim crashes
| * 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
* | fix(ui2): unable to route by message ID #39734luukvbaal2026-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: - "bufwrite" message identifier is encoded in the message ID of a "progress" kind message (since ff68fd6b); UI2 does not allow routing by message ID. - No documented way to set a default message target for all but a few kinds (without copying all of |ui-messages| kinds to cfg.msg.targets). - A user adding a message route for the documented empty "" kind can result in unexpected behavior. - Showing duplicate message (x) indicator in msg and cmd targets simultaneously is unsupported. - Manually triggering CursorMoved autocommand to add matchparen highlighting in the cmdline. Solution: - Match cfg.msg.targets keys as Lua pattern to a message ID. - Recognize "default" as key in cfg.msg.targets, drop the undocumented cfg.msg.target field. - Don't try to get configured target for "" message kind/trigger. - Maintain msg indicator virtual text for the cmd and msg target. - Add matchparen highlighting by directly calling the Lua module (possible since b813c7e0).
* | Merge #39730 from ofseed/lsp-remove-deprecatedJustin M. Keyes2026-05-11
|\ \ | |/ |/|
| * refactor(lsp)!: always require `position_encoding`Yi Ming2026-05-11
| |
| * refactor!: remove deprecated APIsYi Ming2026-05-11
| |
* | fix(lua): vim.wait(0) does not call loop_poll #39679Justin M. Keyes2026-05-10
| | | | | | | | | | | | | | | | | | | | | | Problem: Regression from c822a2657c78: `vim.wait(0)` does not call `loop_poll`, so `vim.wait(1)` is needed to "yield" from Lua. Solution: - Ensure that `vim._core.loop_poll()` is always called, even when `time=0`. - Document how to interrupt Lua code (ctrl-c). ref https://github.com/neovim/neovim/issues/6800
* | feat(lsp): pass arbitrary positions to vim.lsp.buf #39446Yi Ming2026-05-10
| | | | | | | | | | | | | | Problem: Currently, it only supports sending requests using the current cursor position as a parameter. Solution: Support sending requests using arbitrary positions.
* | docs: misc, window #39720Justin M. Keyes2026-05-10
|/ | | | - formalize `window-number` similar to `tabpage-number`. - reference it from docs.
* feat(logging): vim.log #38906Yi Ming2026-05-10
|
* fix(snippet): cancel session on <Esc> in Select mode #39238glepnir2026-05-10
| | | | | | | Problem: <Esc> in a Select-mode tabstop leaves the session and highlight active. CursorMoved isn’t triggered since the cursor doesn’t move. Solution: use ModeChanged (s:n) instead. Defer with vim.schedule() to avoid transient s:n from jump().
* fix(diagnostic): handle `signs = false` in `status()` (#39703)Maria Solano2026-05-09
|
* fix(treesitter): remove default match limit (#39696)Will Lillis2026-05-09
| | | | | | | | Problem: The default match limit of 256 can be too low for realistic use cases, but was necessary to guard against catastrophic performance cliffs. Solution: Performance cliffs were fixed in upstream tree-sitter 0.27+, so remove the fallback limit to return unlimited matches by default.
* refactor(defaults): use public treesitter select()Nathan Zeng2026-05-09
| | | | | | Problem: Default mappings use the private module. Solution: Use the public method.
* 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
* fix(pack): suggest "delete" code action for active plugins #39678Evgeni Chasnovski2026-05-08
| | | | | | | | | | Problem: Trying to execute code action on an active plugin without updates leads to nothing. It is more useful if code actions "do something" on a bigger portion of the confirm buffer. Solution: Suggest "delete" code action even for active plugins. Trying to execute it will first show a confirmation buffer with relevant warning of why this might be not a good idea. Confirming will delete a plugin.
* fix(vim.range): empty ranges semantics vs regular ranges #39474Luis Calle2026-05-08
| | | | | | | | Problem: - Empty ranges have different `<`, `<=`, `has` and `intersect` semantics compared to regular ranges. - `to_inclusive_pos` assumes that the end position of a range is exclusive, which is not true for empty ranges Solution: Special case empty ranges in these operations.
* 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`.
* perf(server): use 1 request instead of 3 #39655Justin M. Keyes2026-05-07
|
* 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
|
* fix(treesitter): drop select() kwargs #39646Justin M. Keyes2026-05-07
| | | | | | | Problem: Unnecessary kwargs. Solution: Use param instead of kwargs.
* 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(pos): pos:to_offset(), pos.offset() #39564Yi Ming2026-05-06
| | | | | | | | | | | | | | | | | | | Problem: For a given position, it is not easy to compare which of several other positions is closest to it. Solution: Add support for converting `vim.Pos` to a buffer byte offset. This allows for sorting, e.g: ```lua table.sort(positions, function(pos1, pos2) return pos1:to_offset() < pos2:to_offset() end ``` Or a binary search, e.g: ```lua vim.list.bisect(positions, pos, { key = function(pos) return pos:to_offset() end }) ```
* Merge #39630 from ofseed/lua-no-memoizeJustin M. Keyes2026-05-06
|\
| * fix(lua): return `v[field]` instead of `nil` when `v[field]` is `false`Yi Ming2026-05-06
| | | | | | | | | | | | | | | | Problem: When `v[field]` returns `false`, the ternary operator will make it return `nil`. Solution: Return `v[field]` once `v` is not `nil`.
| * revert: "perf(lua): memoize `key_fn` results"Yi Ming2026-05-06
| | | | | | | | This reverts commit 83947752412d55fc089a45549bb51ec0863f55fa.
* | fix(lua): increase vim.F deprecation version [skip ci] #39632Mike J McGuirk2026-05-06
| | | | | | | | | | Problem: Deprecations for vim.F set a version too early. Solution: Bump the deprecation version.
* | fix(vim.iter): add richer generic annotationsLewis Russell2026-05-06
| | | | | | | | | | | | | | | | | | | | | | | | Improve the vim.iter annotations with richer generics that track element and tuple types through iterator pipelines, including multi-value stages and list-specific methods. Extend the LuaCATS parser and vimdoc generator so those richer generic classes and overloads round-trip into the generated help. These annotations are only supported by EmmyLua, so LuaLS still uses a broader fallback in _meta.lua. AI-assisted: Codex
* | fix(ui2): entering the pager fails if `<ESC>` is remapped to `:fclose` (#39462)Tomasz N2026-05-06
| | | | | | | | Problem: Entering the pager fails if <ESC> is remapped to :fclose by user. Solution: Avoid executing mappings with nvim_feedkeys() that closes expanded cmdline.
* | 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>
* | fix(ui2): error E518 when typing "vim:" in cmdline #39599STG2026-05-06
|/ | | | | Problem: `vim:`, etc. in cmdline are interpreted as modeline, causing error E518. Solution: Set 'nomodeline' when creating the buffers.
* feat(lua)!: vim.isnil, vim.nonnil, deprecate vim.F #39495Olivia Kinnear2026-05-06
|
* feat(diagnostic)!: deprecate `format` as a table #39603Yi Ming2026-05-06
|
* 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.
* feat(treesitter): provide select() #39069Nathan Zeng2026-05-06
| | | | | Problem: No public method for treesitter incremental selection. Solution: Add `vim.treesitter.select()`.
* perf(lua): memoize `key_fn` results #39568Yi Ming2026-05-05
| | | | | | | | | | | Problem: When using `vim.list.unique` or `vim.list.bisect`, if the `key` function is complex, it can degrade performance, because it is invoked on every comparison Solution: The `key` interface convention is designed specifically to address this issue; performance can be improved by memoizing its results. Also added the shorthand use of the field name string as the key.
* fix(lsp): support nested workspace registrations #39574Tristan Knight2026-05-05
| | | | | | | | | | | Problem: Nested workspace capabilities like workspace.fileOperations.didCreate and workspace.textDocumentContent are not handled consistently for dynamic and static registration provider lookup. Solution: Generate explicit registration-provider mappings from the LSP metadata and use them when registering and querying capabilities. Add coverage for dynamic and static nested workspace registrations.
* fix(lua): avoid `__index` when deciding if a table is a list #39556Yi Ming2026-05-05
| | | | | | | Problem: When a table has `__index`, `vim.islist` is unreliable. Solution: Index using `rawget`.
* fix(vim.net): unreliable integration tests #39594Ellison2026-05-05
|
* fix(diagnostic): status() respects config.signs #39525Yi Ming2026-05-05
| | | | | | | | | Problem: `diagnostic.status` only follows the `config.status.format` setting to determine how to display diagnostic signs. However, `signs` can actually also be configured via `config.signs.text`. Solution: If the user has set symbols via `config.status.format`, let that determine the content of `signs`; otherwise, use `config.signs.text` for display. TODO: drop support `type(config.status.format) == 'table'`; users should just configure `config.signs.text` directly.
* 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>
* fix(treesitter): get_node_text() inconsistent trailing newline #39409David Balatero2026-05-03
| | | | | | | | | | | | | | | | | | Problem: `get_node_text()` returned inconsistent results between buffer and string sources when a node's range ends at `end_col == 0` (i.e. the node ends with a newline). The buffer path dropped the trailing newline; the string path included it correctly. Solution: Append `'\n'` in `buf_range_get_text()` when `end_col == 0` and `start_row ~= end_row`. The `start_row ~= end_row` guard excludes zero-width nodes at column 0, which should return `""`. Remove the workaround in the `#trim!` directive that manually compensated for the missing newline. Strip whitespace in `resolve_lang()` so injection language nodes ending at `end_col == 0` (e.g. `">lua\n"`) still resolve correctly.
* refactor(excmd): pass fargs to Lua for builtin cmds #39528Justin M. Keyes2026-05-02
| | | | | | | | | | | | | | Problem: The fallback that tokenizes `eap->arg` by unescaped whitespace (when the parser doesn't pre-split via `EX_EXPAND` etc.) lives in `nlua_do_ucmd`, so only user-command callbacks got `eap.fargs`. Builtin commands routed through `nlua_call_excmd` have to re-parse the args themselves (e.g. `M.ex_lsp`). Solution: - Move the tokenization into `nlua_push_eap` so every Lua handler sees `eap.fargs`. Keep only the `EX_NOSPC` override in `nlua_do_ucmd` (the `nargs=1`/`?` case which is genuinely user-command-specific). - Drop the re-parse in `M.ex_lsp`.
* 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>
* fix(lsp): dynamic registration for off-spec method #39544Tristan Knight2026-05-01
| | | | | | | | | | | | | Problem: LSP clients previously did not handle dynamic registration for off-spec methods Solution: Update the client logic to assume support for dynamic registration when the method is unknown. Adjust the registration provider fallback and enhance tests to verify correct behaviour for unknown methods and their registration options. This improves compatibility with servers using custom dynamic registrations. AI-assisted: OpenCode