aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
* fix(lsp): wait to display exit message #37925Olivia Kinnear2026-02-18
|
* fix(defaults): 'guifont' "monospace" fallback, trim spaces #37930Rahul Yedida2026-02-18
| | | | | | | | | Problem: Some UI clients break if space follows the comma in 'guifont' items. Also the new 'guifont' default may cause problems if none of the fonts are found. Solution: Remove trailing whitespace. Add a "monospace" fallback which `fontconfig` can resolve on *nix systems.
* fix(ui2): don't change configured message target implicitly #37924luukvbaal2026-02-17
| | | | | Problem: Implicitly setting message target when 'cmdheight' changes. Solution: Just use the user configured target. Support "cmd" target with 'cmdheight' set to 0.
* feat(ui2): show active paging keys in dialog float title #37919luukvbaal2026-02-17
| | | | | | | Problem: Paging keys being consumed without obvious indicator in the dialog window can be surprising. Solution: Display a hint with paging keys in the dialog window title when paging is active. Recognize <Esc> as mapping to stop paging.
* fix(ui2): only set dialog on_key callback once #37905luukvbaal2026-02-16
| | | | | | | | | | | | | | | | Problem: vim.on_key() called for each message while cmdline is open. Cursor is on a seemingly random column when pager is entered. Entering the pager while the cmdline is expanded can be more convenient than pressing "g<". Pager window is unnecessarily clamped to half the shell height. Setting 'laststatus' while pager is open does not adjust its dimensions. Solution: Only call vim.on_key() once when dialog window is opened. Ensure cursor is at the start of the first message when entering the pager. Enter the pager window when "<CR>" is pressed while the cmdline is expanded. Don't clamp the pager window height. Set message windows dimensions when 'laststatus' changes.
* fix(lsp): map all LSP methods to server capabilities (#37910)Tristan Knight2026-02-16
|
* feat(lsp): support `textDocument/documentLink` (#37644)Maria Solano2026-02-16
|
* feat(lua): support vim.Range:has(vim.pos) #37879Maria Solano2026-02-16
|
* feat(defaults): per-platform 'guifont' default #37175Rahul Yedida2026-02-16
| | | | | | | | Problem: Font rendering and kerning are subpar in GUIs. Solution: Set default 'guifont' based on common CSS fonts per: https://github.com/system-fonts/modern-font-stacks#monospace-code
* vim-patch:partial:9.1.1668: items() does not work for Blobszeertzjq2026-02-16
| | | | | | | | | | | | Problem: items() does not work for Blobs Solution: Extend items() to support Blob (Yegappan Lakshmanan). closes: vim/vim#18080 https://github.com/vim/vim/commit/da34f84847d40dc5b1eaad477440e513968047dc Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:3de7384: runtime(doc): Fix :help complete() example (#37891)zeertzjq2026-02-16
| | | | | | | closes: vim/vim#18417 https://github.com/vim/vim/commit/3de73844afebe133ea7485cc9993bb8378a3717d Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* feat(statusline): option to specify stacking highlight groups #37153Riley Bruins2026-02-15
| | | | | | | | **Problem:** No easy way to stack highlight groups #35806. **Solution:** Add a way to specify a new statusline chunk with a highlight group that inherits from previous highlight attributes. Also applies to tabline, etc.
* fix(lsp): support workspace/configuation with no section #27510Tim Pope2026-02-15
| | | | | | | | | | | | | | | | | | | The [spec for `workspace/configuration`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_configuration) marks the `section` property of each item in `items` optional. Therefore, I believe it violates the spec to skip over items without a section, because then the length of the results won't match the length of a valid `items` input. The spec does not elaborate on _what_ to return in this case, but I don't think it would be controversial to say that returning the full configuration, as done for an empty string, is the most natural interpretation. That empty string case, by the way, was initially [added in response](https://github.com/neovim/nvim-lspconfig/commit/5da124fc82c24592abc3a97c68363bb4e85e3c85) to a real world implementation requesting it. I don't have a similar real world implementation to point to for the omitted `section`, but I would note that `getConfiguration()` from `vscode-languageserver-node` [defaults to a request with no section](https://github.com/Microsoft/vscode-languageserver-node/blob/d859bb14d1bcb3923eecaf0ef587e55c48502ccc/server/src/common/configuration.ts#L24-L26) when called with no arguments. I surmise that this is intended as a way to retrieve the full configuration.
* fix(lsp): wait for exit_timeout on quit #37597phanium2026-02-15
| | | | | | | | | | | | | | | | | | | Problem: When quitting Nvim, LSP servers will not be force-stopped, even if ClientConfig.exit_timeout is set to an integer. pkill emmylua_ls; VIMRUNTIME=runtime/ nvim --clean -u repro.lua repro.lua ; waitpid $(pgrep emmylua_ls) vim.lsp.config('foo', { cmd = { 'emmylua_ls' }, exit_timeout = 1000 }) vim.lsp.enable('foo') vim.defer_fn(vim.cmd.quit, 500) Solution: On VimExit, wait up to `exit_timeout:integer` milliseconds for servers to exit. Do this with an explicit `vim.wait()`, because the actual force-stop is deferred, and won't be attempted if Nvim exits before then. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* refactor(lsp): centralize provider capability resolution #37221Tristan Knight2026-02-14
| | | | | | | | - Refactor LSP client to use unified provider-based capability lookup for diagnostics and other features. - Introduce `_provider_value_get` to abstract capability retrieval, supporting both static and dynamic registrations. - Update diagnostic handling and protocol mappings to leverage provider-centric logic.
* fix(pack): explicitly close confirmation window #37861Evgeni Chasnovski2026-02-14
| | | | | | | | | Problem: Executing `nvim_buf_delete()` does not guarantee that the window which shows the buffer is going to close after `:write` or `:quit`. In particular, if there is no listed buffer present. Solution: Explicitly close the window that was created for confirmation buffer. Use `pcall` to catch cases when the window was already closed or when it is the last window.
* feat(diagnostic): fromqflist({merge_lines}) #37416Dmytro Pletenskyi2026-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `vim.diagnostic.fromqflist` ignores lines that are `item.valid == 0` (see `getqflist`). Many qflists have messages that span multiple lines, which look like this: collection/src/Modelling/CdOd/Central.hs|496 col 80| error: [GHC-83865] || • Couldn't match expected type: InstanceWithForm || (FilePath || -> SelectValidCdInstWithForm ... calling `vim.diagnostic.fromqflist(vim.fn.getqflist)` gets a diagnostic message like this: error: [GHC-83865] only the first line is kept, but often, the remaing lines are useful as well. Solution: Introduce `merge_lines` option, which "squashes" lines from invalid qflist items into the error message of the previous valid item, so that we get this diagnostic message instead: error: [GHC-83865] • Couldn't match expected type: InstanceWithForm (FilePath -> SelectValidCdInstWithForm
* refactor(help): move local-additions to Lua #37831Yochem van Rosmalen2026-02-14
| | | | | | | | | | | Problem: - ~200 line function of hard-to-maintain C code. - Local Addition section looks messy because of the varying description formats. Solution: - Move code to Lua. - Have a best-effort approach where short descriptions are right aligned, giving a cleaner look. Long descriptions are untouched.
* docs(lua): correct vim.wait() interval description (#37856)zeertzjq2026-02-14
| | | Use the wording from the wait() Vimscript function.
* vim-patch:9.1.2146: filetype: cel files are not recognized (#37834)zeertzjq2026-02-13
| | | | | | | | | | | | | | | Problem: filetype: cel files are not recognized Solution: Detect *.cel files as cel filetype (Stefan VanBuren). Reference: https://cel.dev/ https://github.com/google/cel-java/blob/e36c49febc36bcb16ef4f07274fcc8873c1eee59/testing/src/test/resources/expressions/coverage_test_case/simple_expression.cel https://github.com/elastic/mito/blob/d0d2dbabae5c563dd943c61fd52992acb655942d/example.cel closes: vim/vim#19381 https://github.com/vim/vim/commit/fb5777fa209785db6aa439b712cab814264e05ca Co-authored-by: Stefan VanBuren <svanburen@buf.build>
* feat(iter): peek(), skip(predicate) for non-list iterators #37604Elijah Koulaxis2026-02-12
| | | | | | | | | | | | Problem: Iter:peek() only works if the iterator is a |list-iterator| (internally, an `ArrayIter`). However, it is possible to implement :peek() support for any iterator. Solution: - add `_peeked` buffer for lookahead without actually consuming values - `peek()` now works for function, pairs(), and array iterators - `skip(predicate)` stops at the first non matching element without consuming it - keep existing optimized behavior for `ArrayIter` to maintain backward compatibility - use `pack`/`unpack` to support iterators that return multiple values
* fix(ui2): incomplete :echon message in g< pager #37819phanium2026-02-12
| | | | | | | Problem: `:echo 1 | echon 2<cr>g<` shows "2", but should be "12". Solution: Don't clear temp msg (g<) if we are appending.
* Merge #37096 from justinmk/doc2Justin M. Keyes2026-02-12
|\
| * fix(health): avoid silent failureJustin M. Keyes2026-02-12
| |
| * docs: vim.fs path expansionJustin M. Keyes2026-02-12
| | | | | | | | fix #37583
| * docs: lsp, options, promptbufJustin M. Keyes2026-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | Close #37630 Close #37682 Close #37762 Close #37785 Co-authored-by: Daniel Schmitt <d.schmitt@lansoftware.de> Co-authored-by: Duane Hilton <duane9@gmail.com> Co-authored-by: NeOzay <colpaert.benoit@gmail.com> Co-authored-by: Yi Ming <ofseed@foxmail.com> Co-authored-by: "Justin M. Keyes" <justinkz@gmail.com>
* | fix(treesitter): highlight group for EditQuery captures #36265Michele Campeotto2026-02-12
|/ | | | | | | | | | | fix(treesitter): more distinctive highlight for EditQuery captures Problem: EditQuery shows captures in the source buffer using the Title highlight group, which could be too similar to Normal. Solution: Use a virtual text diagnostic highlight group: they are displayed in a similar manner to the query captures so we can assume that the color scheme should have appropriate styling applied to make them visible.
* refactor(lsp): drop once(), use _memoize() #37829Justin M. Keyes2026-02-12
|
* fix(pack): skip :redraw! if headless #37782Andrew Braxton2026-02-12
| | | | | Otherwise, output will be concatenated without newlines. TODO: the ":redraw!" call can be dropped entirely after ui2 becomes the default.
* feat(stdlib): vim.json.decode() can allow comments #37795skewb1k2026-02-11
| | | | | | | | | Problem: `vim.json.decode()` could not parse JSONC (JSON with Comments) extension, which is commonly used in configuration files. Solution: Introduce an `skip_comments` option, which is disabled by default. When enabled, allows JavaScript-style comments within JSON data.
* feat(lua): add `Iter:unique()` (#37592)Olivia Kinnear2026-02-10
|
* fix(vim.fs): make `rm()` work with symlink to a directoryEvgeni Chasnovski2026-02-10
|
* refactor(help): move escaping logic to Lua #37757Yochem van Rosmalen2026-02-10
| | | | | | | | | | Problem: Escaping logic for {subject} in ex cmd `:help {subject}` is done in a messy 200+ lines C function which is hard to maintain and improve. Solution: Rewrite in Lua. Use `string.gsub()` instead of looping over characters to improve clarity and add many more tests to be able to confidently improve current code later on.
* fix(health): check stable release for non-nightly build #36715glepnir2026-02-10
| | | | | | | Problem: Nvim version is always compared to latest upstream HEAD. Solution: If current Nvim is not a nightly build, check upstream stable version.
* fix(api): cterm type in highlight keyset #37802glepnir2026-02-10
| | | | | | | | Problem: cterm field in Dict(highlight) is declared as Union(Integer, String) but it actually expects a Dict(highlight_cterm). Solution: change cterm type to DictAs(highlight__cterm) and simplify the handling in dict2hlattrs since type validation and empty array compat are already handled by api_dict_to_keydict.
* vim-patch:9e456e5: runtime(doc): clarify the use of 'iskeyword' option valuezeertzjq2026-02-10
| | | | | | | | | | | In particular, also mention the difference between the regex atom \k and what Vim considers for a word character. closes: vim/vim#18688 https://github.com/vim/vim/commit/9e456e52df83f64075ce94c9a5adc43e221a6d3c Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix(lsp): error on omnifunc completion (#37790)phanium2026-02-09
| | | | | | | | | | | Problem: After eaacdc9, complete with emmylua_ls error with: runtime/lua/vim/lsp/completion.lua:586: attempt to get length of field 'items' (a nil value) Solution: Result can be CompletionItem[] according the spec: > If a `CompletionItem[]` is provided, it is interpreted to be complete, > so it is the same as `{ isIncomplete: false, items }`
* fix(lsp): ignore empty response on trigger completion #37663Tomasz N2026-02-08
| | | | | | | | Problem: Empty response affects server start boundary computed before. Solution: Ignore empty responses. This is mostly micro-optimization that avoids extending existing results with empty responses.
* feat(lsp): display codelens as virtual lines, not virtual text #36469Mike J McGuirk2026-02-08
| | | | | | | | | | | | Problem: Code lenses currently display as virtual text on the same line and after the relevant item. While the spec does not say how lenses should be rendered, above the line is most typical. For longer lines, lenses rendered as virtual text can run off the side of the screen. Solution: Display lenses as virtual lines above the text. Closes https://github.com/neovim/neovim/issues/33923 Co-authored-by: Yi Ming <ofseed@foxmail.com>
* fix(pack): close confirmation buffer, not tabpage #37756Evgeni Chasnovski2026-02-08
|
* docs(eval): fix fn.strchar types #37737Mike J McGuirk2026-02-08
| | | | | | | | | | | | | | | | Problem: The following strchar functions have incorrect types: strcharlen() - Currently any. Always returns an integer, including on error strcharpart() - The skipcc annotation does not specify that 0 and 1 are valid. These inputs are required for vimscript usage. The current return type is any, even though the function returns an empty string on error strchars() - The skipcc annotation does not specify that 0 and 1 are valid Solution: Update the problem types.
* docs(eval): correct types for getcharsearch, setcharsearch #37734Mike J McGuirk2026-02-08
| | | | | | | | | Problem: In eval.lua, setcharsearch() has an incorrect param type, causing Lua_Ls to display an error when a valid table is passed. While getcharsearch correctly states that it returns a table, the type is non-specific about the contents. Solution: Update eval.lua with the correct types.
* refactor(lsp): always fetch lenses again in codelens.run (#37720)Mathias Fußenegger2026-02-06
| | | | | | | | | | | | | | | | | | | The auto-refresh has a bit of a delay so it can happen that when a user runs `codelens.run` it operates on an outdated state and either does nothing, or fails. This changes the logic for `.run` to always fetch the current lenses before (optional) prompt and execution. See discussion in https://github.com/neovim/neovim/pull/37689#discussion_r2764235931 This could potentially be optimized to first check if there's local state with a version that matches the current buf-version, but in my testing re-fetching them always was quickly enough that `run` still feels instant and doing it this way simplifies the logic. Side effect of the change is that `.run` also works if codelens aren't enabled - for power users who know what the codelens would show that can be useful.
* fix(ui2): always route to dialog when cmdline is open #37730luukvbaal2026-02-05
| | | | | Problem: Messages emitted while cmdline is open are not shown with cmdline message target. Solution: Route to dialog window when cmdline is open.
* docs(lua): vim.keymap.set takes no `noremap` #37723Christian Clason2026-02-05
| | | | | | | Problem: Unlike `nvim_keymap_set`, `vim.keymap.set` uses the non-negated `remap` instead of `:set`'s `noremap`, but the documentation for this got lost sometime before Nvim 0.10. Solution: Restore the lost documentation and make it more explicit.
* refactor: rename _extui => _core.ui2 #37692luukvbaal2026-02-05
| | | | | | | Problem: _extui module name is confusing and should eventually end up in _core/. Solution: Move it there and name it ui2.
* fix(ui2): only copy highlight marks when expanding cmdline #37709luukvbaal2026-02-04
| | | | Problem: Error copying over multi-line message span marks to expanded cmdline. Solution: Only copy over the highlight marks as intended.
* feat(ui2): replace message by its ID #37672luukvbaal2026-02-04
| | | | | | | Problem: UI2 does not implement the msg_show event msg_id parameter. Solution: Store message IDs currently shown in the cmd/msg buffers. Set extmarks spanning the message which are used to replace a still visible message when a new message with the same ID is received.
* fix(ui2): don't adjust dialog pos for pum wildmenu (#37695)Sean Dewar2026-02-04
| | | | Problem: Dialog position unnecessarily adjusted for pum wildmenu. Solution: Apply no offset if the pum is visible.
* fix(lsp): don't empty server start-boundary by next client response #37665Tomasz N2026-02-03
| | | | | | | Problem: Server start boundary can be emptied by response provided by next client. Solution: Don't empty it when extending the result list.