aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
* | | fix(ui2): ensure expanded cmdline is closed after :<Esc> (#38187)luukvbaal2026-03-07
| | | | | | | | | | | | | | | | | | Problem: Expanded cmdline is left open after entering the cmdline again without entering a command that emits another message (after 301c7065). Solution: Wait for msg_show to reinstate the vim.on_key() handler. If there was no message close the expanded cmdline.
* | | docs(api): clarify nvim_win_set_buf documentation #37201Marc Jakobi2026-03-06
| | |
* | | fix(ui2): only highlight Ex command lines in the cmdline #38182luukvbaal2026-03-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Prompts and message text (in block mode) in the cmdline are parsed and highlighted as if it is Vimscript. Entering the cmdline while it is expanded can work more like it does with UI1, where the press enter prompt is replaced and previous messages stay on the message grid, while subsequent messages are placed below it. Solution: Highlight manually with string parser on lines starting with ':'. Spoof cmdline block mode when the cmdline is entered while it is expanded.
* | | fix(ui2): immediately open target windows on new tabpage (#38170)luukvbaal2026-03-06
| | | | | | | | | | | | | | | Problem: Previous tests for this relied on other events opening the targets, which are not guaranteed to happen. Solution: Open target windows when entering a new tabpage.
* | | fix(health): improve version check for nightly builds #38147glepnir2026-03-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: nightly builds were always compared against HEAD, causing false outdated warnings. Solution: fetch both HEAD and refs/tags/nightly, match local commit against HEAD first, fall back to nightly if no match. Fix #38141
* | | fix(lsp): update metamodel (#38174)Maria Solano2026-03-05
| | |
* | | fix(lsp): ignore stale codelens resolve responses (#38153)Lewis Russell2026-03-04
| | |
* | | fix(checkhealth): don't wrap command in cmd.exe (#38158)zeertzjq2026-03-05
| | | | | | | | | This was introduced in #6608 and is unnecessary since #9516 and #31109.
* | | fix(treesitter): normalize language aliasesStefan VanBuren2026-03-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hyphenated language names are silently dropped when used as injections (see #38132). This combines the normalization of language aliases into `resolve_lang`, and also adds the normalization of hyphens to underscores, which allows for handling of injected language tags with hyphens in their names. Fixes #38132.
* | | fix(pack): ensure `data` spec is passed in events during lockfile sync #38139Evgeni Chasnovski2026-03-03
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: During initial "bootstrap" via lockfile synchronization, the whole plugin specification is reconstructed from the lockfile data, ignoring potential user changes added in the first `vim.pack.add()`. This is enough in most situations since it is the only data needed for actual installation. However, this affects specification passed to `PackChanged[Pre]` events. In particular, `data` field is missing which can be a problem if there is a `PackChanged kind=install` hook that uses that field (like with some kind of `build` method used during install). And there might be different `version` set in `vim.pack.add()`. Solution: Pass the `specs` input of the first `vim.pack.add()` down to lockfile synchronization and use it to reconstruct plugin specification for the to-be-installed plugin. If present among the user's `specs`, it is used but with forced `src` from the lockfile (as it is the one used during installation). Note that this still has a caveat when using separate `vim.pack.add()`, as only the specs from the first input (when the lockfile synchronization happens) is taken into account.
* | fix(api): return "style" in nvim_win_get_config() #38122Sean Dewar2026-03-03
| | | | | | | | | | | | | | | | | | | | Problem: nvim_win_get_config() does not return a window's "style". Solution: always include it, and document `style=""`. Always included so it can be used reciprocally with nvim_open_win() or nvim_win_set_config(). (otherwise the config of a window with kWinStyleUnused will not unset the kWinStyleMinimal style of another window if passed to nvim_win_set_config, for example)
* | vim-patch:73f4162: runtime(doc): Tweak doc style in options.txtzeertzjq2026-03-03
| | | | | | | | | | | | https://github.com/vim/vim/commit/73f41626df1f1764007f073088048ffea4f970c4 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* | vim-patch:9.2.0088: cannot display tabs for indentationzeertzjq2026-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: cannot display tabs for indentation Solution: Add the "leadtab" value to the 'listchars' option to distinguish between tabs used for indentation and tabs used for alignment (HarshK97). closes: vim/vim#19094 https://github.com/vim/vim/commit/8526d32647245b3b623986949e7807b4b353e624 Co-authored-by: HarshK97 <harshkapse1234@gmail.com>
* | test: suppress DSR wait warning when running tests (#38126)zeertzjq2026-03-02
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The DSR wait warning causes any test that involves Nvim TUI to become flaky on Windows. Example: FAILED test/functional/terminal/cursor_spec.lua @ 367: :terminal cursor can be positioned arbitrarily test/functional/terminal\cursor_spec.lua:377: Row 1 did not match. Expected: |*^ | |*~ | |*~ | |*~ | |*~ | |* | |{5:-- TERMINAL --} | Actual: |* | |* | |*{2: }| |*{103:defaults.lua: Did not detect DSR response from ter}| |*{103:minal. This results in a slower startup time. }| |*{UNEXPECTED foreground = tonumber('0x000006'):Press ENTER or type command to continue^ }| |{5:-- TERMINAL --} | Solution: Don't show the DSR wait warning when running tests.
* feat(lsp): show color preview in completion items #32138glepnir2026-02-28
| | | | | Problem: Color completion items display as plain text without visual preview Solution: Parse RGB/hex colors from documentation and render with colored symbol ■
* feat(ui2): configure targets per message kind #38091luukvbaal2026-02-28
| | | | | | | | | Problem: Unable to configure message targets based on message kind. Solution: Add cfg.msg.targets mapping message kinds to "cmd/msg/pager". Check the configured target when writing the message. cfg.msg = { target = 'cmd', targets = { progress = 'msg', list_cmd = 'pager' } } will for example use the 'msg' target for progress messages, immediately open the pager for 'list_cmd' and use the cmdline for all other message kinds.
* fix(help): better align local-additions #38097Yochem van Rosmalen2026-02-27
| | | | | | | | | | | | | | | | | | | | | | | Problem: Descriptions of plugins often contain taglinks which are generally concealed. This misaligns them by 2 characters with descriptions that don't have a taglink in them. Solution: Don't count "bar" characters (`|`) for the description width. Example: Actual buffer content: ``` myplugin.txt |lsp| is cool myplugin.txt this is a nice plugin ``` Rendered as: ``` myplugin.txt lsp is cool myplugin.txt this is a nice plugin ```
* fix(vim.fs): joinpath() should ignore empty items #38077Yochem van Rosmalen2026-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: vim.fs.joinpath treats empty string as a path segment (it adds a path separator for each empty item): print(vim.fs.joinpath('', 'after/lsp', '')) -- '/after/lsp/' print(vim.fs.joinpath('', '')) -- '/' Especially problematic if the empty segment is the first segment, as that converts the path to an absolute path. Solution: Ignore empty (length of 0) path segments. Benchmark: local function test(func) local t = vim.uv.hrtime() for _ = 1, 100000, 1 do func('', 'this/is', 'a/very/long/path', '', 'it', 'really', 'is') end print(math.floor((vim.uv.hrtime() - t) / 1e6), 'ms') end - with Iter():filter() --> 370 ms - building new segments table --> 208 ms - with vim.tbl_filter --> 232 ms - Instead of gsub split on `/` in all parts --> 1870 ms
* fix(startup): wait for bg detection before user config #37075Kyle2026-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Automatic background detection sets the background option too late, which loads colorschemes twice and causes problems when the user's terminal background doesn't match the default (#32109, #36211, #36416). Solution: Use a DA1 query to determine whether the TTY supports OSC 11. Wait for background detection and setting to complete before processing user config. Note: To preserve the existing behavior as much as possible, this triggers OptionSet manually on VimEnter (since it won't trigger automatically if we set bg during startup). However, I'm unsure if this behavior is truly desired given that the documentation says OptionSet is triggered "After setting an option (except during |startup|)." Also fixes flickering issue #28667. To check for flickering: nvim --clean --cmd "set termguicolors" --cmd "echo \"foo\"" --cmd "sleep 10" On master, this gives me a black screen for 10 seconds, but on this branch, the background is dark or light depending on the terminal background (since the option is now set during startup rather than after VimEnter).
* fix(lps): separate namespaces for pull/push diagnostics #37938Riccardo Mazzarini2026-02-26
| | | | | | | | | | | | | Problem: Regression from b99cdd0: Pull diagnostics (from `textDocument/diagnostic`) and push diagnostics (from `textDocument/publishDiagnostics`) use the same namespace, which is a problem when using language servers that publish two different sets of diagnostics on push vs pull, like rust-analyzer (see https://github.com/rust-lang/rust-analyzer/issues/18709#issuecomment-2551394047). Solution: Rename `is_pull` to `pull_id` which accepts a pull namespace instead of just a boolean.
* vim-patch:9.2.0061: Not possible to know when a session will be loaded (#38071)zeertzjq2026-02-26
| | | | | | | | | | | Problem: Not possible to know when a session will be loaded. Solution: Add the SessionLoadPre autocommand (Colin Kennedy). fixes: vim/vim#19084 closes: vim/vim#19306 https://github.com/vim/vim/commit/1c0d468d72e0220d4cb25936043ac35439a981b5 Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
* feat(secure): allow 'path' parameter for trust action 'allow' (#38001)anondeveg2026-02-25
|
* fix(diagnostic): handle stale diagnostic extmark ids #38060Mathias Fußenegger2026-02-25
| | | | | | | | | | | | | | | Problem: If a server is slow with catching up, there can be stale diagnostics for deleted lines. Then if a user uses `jump` it can error like: E5108: Lua: ...runtime/lua/vim/diagnostic.lua:670: attempt to index a nil value stack traceback: ...runtime/lua/vim/diagnostic.lua:670: in function 'get_logical_pos' ...runtime/lua/vim/diagnostic.lua:687: in function 'diagnostic_lines' ...runtime/lua/vim/diagnostic.lua:1122: in function 'next_diagnostic' ...runtime/lua/vim/diagnostic.lua:1665: in function 'jump' Solution: Fallback to diagnostic location. That's better than the failure.
* fix(ui2): leftover empty lines in msg window #38059luukvbaal2026-02-25
| | | | | Problem: Timer removing a message from the msg buffer does not remove empty lines if window is closed (col([ui.wins.msg]) fails). Solution: Use nvim_buf_get_text() to check if line is empty.
* feat(startup): provide v:argf for file arguments #35889Sanzhar Kuandyk2026-02-25
| | | | | | | | | | | | | | | | | | Problem: - `:args` and `argv()` can change after startup. - `v:arg` includes options/commands, not just files. - Plugins (e.g. Oil) may rewrite directory args. Solution: - New read-only var `v:argf`: snapshot of file/dir args at startup. - Unaffected by `:args` or plugins. - Unlike `v:argv`, excludes options/commands. - Paths are resolved to absolute paths when possible Example: nvim file1.txt dir1 file2.txt :echo v:argf " ['/home/user/project/file1.txt', '/home/user/project/dir1', '/home/user/project/file2.txt']
* vim-patch:9.2.0046: filetype: neon files are not recoginzed (#38049)zeertzjq2026-02-25
| | | | | | | | | | | | | | | Problem: filetype: neon files are not recoginzed Solution: Detect *.neon files as neon filetype (przepompownia) Reference: https://doc.nette.org/en/neon/format https://github.com/fpob/nette.vim closes: vim/vim#19496 https://github.com/vim/vim/commit/ddd90672f2ddc170cb8f035e42302468f02d341a Co-authored-by: przepompownia <przepompownia@users.noreply.github.com>
* fix(ui2): multiline/color replaced message, expanded cmdline, error messages ↵luukvbaal2026-02-24
| | | | | | | | | | | | | | | | | | | | | | | #38044 Problem: - Unintentionally inserting lines for a replaced multiline message that also has multiple highlights. - Scheduled check to see if the expanded cmdline window was entered makes it difficult to keep track of what happens when the key pressed to dismiss it results in a message. - Reading the first line of an error message should be enough notice for something going wrong. - "search_cmd" messages should not be shown with 0 'cmdheight'. - Unable to configure dynamically changed pager height. - Enabling UI2 doesn't make sense with no UIs attached. Solution: - Only insert a line for the first chunk after a newline. - Use getmousepos() to check if the expanded cmdline was clicked to enter the pager. entering the pager to serve as a configuration interface. - Don't expand the cmdline for error messages; user can press g<. - Don't show "search_cmd" messages with 'cmdheight' set to 0. - Change 'eventignorewin' to ensure WinEnter is fired when - Have enable() return early when no UIs are attached.
* fix(treesitter): InspectTree only show the largest injection #37906phanium2026-02-24
| | | | | | | | | | | Problem: :InspectTree don't show luadoc injection lua file. Since luadoc share the same "root" with comment in their common primary (lua) tree. Current logic simply show the largest (comment injection) and ignore all smaller one (luadoc injection). Solution: Handle different lang injections separately. Then sort them by byte_length to ensure the draw tree consistent.
* fix(watch): invalid joined path #37973Oleksandr Chekhovskyi2026-02-23
| | | | | | | | | | | | | Problem: When vim._watch.watch() is used to watch a single file, libuv returns the basename as the filename argument in the callback. The code joins this with the watched path, producing a nonsensical path like "/path/to/file.lua/file.lua", which causes ENOTDIR errors on subsequent fs_stat calls. Solution: Check whether the watched path is a directory before joining the filename. When watching a file, ignore the filename from libuv and use the watched path directly.
* fix(lsp): only resolve LSP configs once (#38007)Andrew Braxton2026-02-23
| | | | | | | | | | | | | | | `lsp.config[]` resolves an LSP config the first time it is called, and returns the cached result on subsequent calls. The change in #37571 added an extra call to `lsp.config[]` which will resolve the config *before* the server is added to `_enabled_configs`, meaning the result is discarded. That means configs will be needlessly resolved again once `lsp_enable_callback` fires for the first time. That includes an additional `loadfile()` call which is relatively expensive and can have unexpected side effects. Avoid this by storing the result of the initial call to `lsp.config[]` in `_enabled_configs` so the config is not resolved a second time once `lsp_enable_callback` is called for the first time.
* fix(api): win_config `border` type #38030glepnir2026-02-23
| | | | | Problem: ArrayOf(String) doesn't cover mixed string/array border chars. Solution: use Union(Array, Enum(...)) to match parse_border_style behavior.
* fix(statusline): broken statusline on error #38000Sean Dewar2026-02-23
| | | | | | | | | | Problem: after #33036, an error from evaluating 'statusline' clears it and doesn't draw the statusline. (causing glitchy redraws) Solution: use the default value instead. If 'stl' is somehow ever empty, still call redraw_custom_statusline to at least draw an empty statusline. Ideally our default 'stl' shouldn't itself error too! :-) Also adjust some prior screen:expect()s to avoid immediate success warnings.
* docs(api): nvim_open_win "split" with negative "win" #38032Sean Dewar2026-02-23
| | | Acts like :topleft/botright.
* refactor: defer_fn return type #37999Justin M. Keyes2026-02-23
|
* fix(health): check more "old" files #38028Justin M. Keyes2026-02-23
|
* fix(lsp): vim.lsp.completion clean up triggers on client detach (#38009)glepnir2026-02-22
| | | | | Problem: LspDetach didn't clean up stale client refs in triggers table. Solution: create LspDetach autocmd and call disable_completion.
* docs: highlight, terminal SGR #37998Justin M. Keyes2026-02-21
|
* vim-patch:9.2.0036: completion: thesaurus completion incorrect with ↵zeertzjq2026-02-21
| | | | | | | | | | | | | | | "longest/fuzzy" (#37996) Problem: completion: thesaurus completion incorrect with "longest/fuzzy" (Mao-Yining) Solution: Disable fuzzy matching and longest-match insertion specifically for thesaurus completion (Girish Palya). fixes: vim/vim#19356 closes: vim/vim#19475 https://github.com/vim/vim/commit/26a3f486cc708b285b20e92c206f1615d20b23b6 Co-authored-by: Girish Palya <girishji@gmail.com>
* feat(highlight): support more SGR attributes #37901Riccardo Mazzarini2026-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: TUI does not support several standard SGR text attributes: - dim/faint (SGR 2) - blink (SGR 5) - conceal (SGR 8) - overline (SGR 53) This means that when a program running in the embedded terminal emits one of these escape codes, we drop it and don't surface it to the outer terminal. Solution: - Add support for those attributes. - Also add corresponding flags to `nvim_set_hl` opts, so users can set these attributes in highlight groups. - refactor(highlight): widen `HlAttrFlags` from `int16_t` to `int32_t` Widen the `rgb_ae_attr` and `cterm_ae_attr` fields in HlAttrs from int16_t to int32_t to make room for new highlight attribute flags, since there was only one spare bit left. - The C flag is named HL_CONCEALED to avoid colliding with the existing HL_CONCEAL in syntax.h (which is a syntax group flag, not an SGR attribute). - Also note that libvterm doesn't currently support the dim and overline attributes, so e.g. `printf '\e[2mThis should be dim\n'` and `printf '\e[53mThis should have an overline\n'` are still not rendered correctly when run from the embedded terminal.
* vim-patch:9.2.0033: filetype: sh filetype used for env fileszeertzjq2026-02-20
| | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: sh filetype used for env files Solution: Detect *.env and .env.* files as env filetype, detect .envrc and .envrc.* as sh filetype, include a simple env syntax script (DuckAfire) Previously, .env files were handled by the shell syntax. While functional, this limited the ability to support specific .env implementations, such as CodeIgniter4 which allows dots in keys (e.g., "foo.bar=0"). The new dedicated 'env' filetype and syntax script improves legibility and prevents highlighting from breaking when encountering spaces. Currently, the syntax does not support indentation; fields, variables, and comments must start at the beginning of the line. closes: vim/vim#19260 https://github.com/vim/vim/commit/d0fa375629b1bfdb8dc054894ca81d7473268455 Co-authored-by: DuckAfire <155199080+duckafire@users.noreply.github.com>
* vim-patch:9.2.0027: filetype: yara files are not recognizedzeertzjq2026-02-20
| | | | | | | | | | | | | | | | Problem: filetype: yara files are not recognized Solution: Detect *.yara and *.yar files as yara filetype (Thomas Dupuy). Reference: - https://github.com/VirusTotal/yara - https://github.com/VirusTotal/yara-x closes: vim/vim#19460 https://github.com/vim/vim/commit/7d93ae57f0dc9da7eee8d582dd0d5a22922ffed8 Co-authored-by: Thomas Dupuy <thom4s.d@gmail.com>
* fix(treesitter): :InspectTree wrong title for non-relative path #37965zeertzjq2026-02-19
| | | | Problem: :InspectTree sets wrong title for file with non-relative path. Solution: Use full path if relpath() returns nil.
* fix(defaults): silent `gx` if no `textDocument/documentLink` support #37969Evgeni Chasnovski2026-02-19
| | | | | | | | Problem: If buffer has attached LSP servers and none of them supports `textDocument/documentLink` method, typing `gx` results in a warning about that. Solution: Explicitly check that at least one server supports the target method before making the LSP request.
* vim-patch:9.2.0025: filetype: cshtml incorrectly recognized (#37957)zeertzjq2026-02-19
| | | | | | | | | | | | | | | Problem: filetype: cshtml incorrectly recognized, razor files are not recognized Solution: Detect *.cshtml and *.razor files as razor filetype (tris203) Reference: https://learn.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-10.0 closes: vim/vim#19207 https://github.com/vim/vim/commit/68dbb58d5189d1293b0f8e032af6bcb84101bd86 Co-authored-by: tris203 <admin@snappeh.com>
* fix(lsp): add `vim.deprecate` call to `vim.lsp.with` (#37960)Maria Solano2026-02-18
|
* fix(lsp): use entire line as completion word (#37949)Maria Solano2026-02-18
|
* 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.
*