aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
* Merge #40910 from barrettruth/fix/dir-literal-env-pathsJustin M. Keyes2026-07-26
|\
| * feat(vim.fs): dir(opts.normalize)Barrett Ruth2026-07-25
| |
* | vim-patch:770eb7d: runtime(doc): clarify expandcmd() and "~" behaviourzeertzjq2026-07-26
| | | | | | | | | | | | | | | | fixes: vim/vim#20793 https://github.com/vim/vim/commit/770eb7db17c44e41fc4eb1975d67f9ec022edb58 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* | fix(api): add `lhs` option for keymap deletionBarrett Ruth2026-07-25
| |
* | docs: misc #40847Justin M. Keyes2026-07-25
| | | | | | | | Co-authored-by: Barrett Ruth <br@barrettruth.com> Co-authored-by: Nathan Zeng <nathan.j.zeng@gmail.com>
* | vim-patch:0c1a214: runtime(doc): Fix truncated sentence in :h map()zeertzjq2026-07-25
| | | | | | | | | | | | | | | | fixes: vim/vim#20725 https://github.com/vim/vim/commit/0c1a214497400a950f1e25f4163215ec930a4659 Co-authored-by: Christian Brabandt <cb@256bit.org>
* | vim-patch:9.2.0849: filetype: osquery config files are not recognizedzeertzjq2026-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: osquery config files are not recognized. Solution: Detect osquery.conf as jsonc filetype (Fionn Fitzmaurice). Reference: https://osquery.readthedocs.io/en/stable/deployment/configuration/#configuration-components closes: vim/vim#20826 https://github.com/vim/vim/commit/ea183ce4e5fb82d389e71f5de8f7564ee399d49c Co-authored-by: Fionn Fitzmaurice <fionn@github.com>
* | feat(health): improvements to :checkhealth #40935Olivia Kinnear2026-07-24
| | | | | | | | | | | | | | Changes: - Removed the blank line before the first healthcheck header. - Fixed a bug where the entire "Terminal" section of `vim.health` would not appear if the `infocmp` executable was not found. - Fixed a typo in `vim.lsp` when displaying the LSP log level.
* | feat(options): schema, "dict" options, messagesJustin M. Keyes2026-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Options parsing is still painful for dict-style options. Solution: schema-maxxing => better `opt:get()` (will be the basis for `vim.o()`), unified (and more-detailed) err msgs. - Drop bespoke structure-builder in `_core/options.lua`. - Define `schema` for all non-primitive options (except 'guicursor' and statusline-style options); generate reified keysets `OptKeyDict`). - Generate 'fillchars' => `fcs_tab`, 'listchars' => `lcs_tab`. - `nvim_set_option_value`: - Return the improved structures. Also from `vim.opt.x:get()`. - Eliminate api <=> lua roundtrip, centralize option structure handling. - Improve/unify errors. - Bump ERR_BUFLEN 80 → 256 so the "one of" list isn't truncated. - Eliminate old 'diffopt' order-dependence (`iwhiteall` before `iwhite`) Error samples: Typed-key path (opt_strings_check → diffopt/mousescroll/breakindentopt): E474: Unknown item 'foo' E474: 'context' requires a number E474: 'ver' number is out of range E474: 'algorithm' must be one of: myers, minimal, patience, histogram E474: 'filler' does not take a value Related: - #31084 - #34661 - #31820 - #14739 - #20107 - fix #18875 - :get() returns `{ sbr = true, shift = '3' }` (reified-keyset) instead of `{'sbr', 'shift:3'}` - Setting via table now works too. `object_as_optval_for` `is_map` now recognizes struct options. - fix #30296 - instead of `E474: Invalid argument`, errors now look like: ``` E474: Invalid value 'x', expected one of: single, double: ambiwidth=x E474: Unknown item 'foo': diffopt=foo E474: 'context' requires a number: diffopt=context:x ``` simplify `win_float_parse_option` from #26799.
* | fix(text): validate `opts.expandtab` in `vim.text.indent()` #40936Maria Solano2026-07-24
| |
* | feat(float): 'previewpopup' option #26799glepnir2026-07-23
| | | | | | | | | | | | | | | | Problem: The preview-window (:pedit, etc.) always uses a split, but it would be useful as a floatwin (or "popup"). Solution: Support Vim's 'previewpopup' option.
* | vim-patch:9.2.0830: the completion menu is not used on terminals without ↵zeertzjq2026-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | colors (#40917) Problem: When the terminal reports no colors ("t_Co" is 0 or 1) the insert mode completion popup menu is not shown at all, while the command line completion popup menu ('wildoptions' contains "pum") is shown. In 'wildmenu' completion the current match cannot be told apart from the other matches (Maxim Kim) Solution: Show the insert mode completion popup menu regardless of the number of colors and add "term" attributes to the default highlighting of Pmenu, PmenuSel and PmenuThumb. The wildmenu is drawn with the attributes of the status line, which is reversed, and on most terminals the standout mode is the same as the reverse mode, thus use the underline mode for the default highlighting of WildMenu (Hirohito Higashi). fixes: vim/vim#20800 closes: vim/vim#20803 https://github.com/vim/vim/commit/52485e0d24ade45e02ecba9aeadaec66500d15fe Co-authored-by: Hirohito Higashi <h.east.727@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* | vim-patch:9.2.0836: filetype: .git-blame-ignore-revs file is not recognized ↵zeertzjq2026-07-23
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | (#40912) Problem: filetype: .git-blame-ignore-revs file is not recognized Solution: Detect .git-blame-ignore-revs file as gitrevlist filetype, include syntax and filetype plugins (Fionn Fitzmaurice) A Git revision list is > a list of object names (i.e. one unabbreviated SHA-1 per line)..., > comments (#), empty lines, and any leading and trailing whitespace are > ignored. (from Git's fsck.skipList documentation). The default output of git rev-list will match this. It is also suitable as input to git blame --ignore-revs-file. This adds filetype detection matching .git-blame-ignore-revs files, syntax highlighting and basic filetype settings. closes: vim/vim#20702 https://github.com/vim/vim/commit/a8d5be92845df7fc0e9e4399545bd5c01bba536a Co-authored-by: Fionn Fitzmaurice <fionn@github.com>
* fix(help): handle escape edge cases #40901phanium2026-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix(help): preserve multi-letter CTRL modifiers in :help subject Problem: After PR 39537 normalized `CTRL-U-default` by excluding `-` from the trigger char class, the regex `(CTRL%-[^{])([^-_\\])` also fires between `CTRL-S` and the `H` of the `SHIFT` modifier in tags like `c_CTRL-SHIFT-V`, splitting it into the non-existent `c_CTRL-S_HIFT-V`. Solution: Exclude uppercase letters from the char class so a multi-letter modifier following `CTRL-X` (e.g. `SHIFT`, `ALT`) is no longer split. The `-` exclusion from 39537 is preserved so `i_CTRL-U-default` still works. * fix(help): escape ~ in expr-=~? exception to keep regex valid Problem: The `expr-=~?` exception in the tag alias table maps to `=~?`, but in Vim's regex engine `~` refers to the previous substitute pattern. With no prior substitute the pattern fails to compile, so `:help expr-=~?` returns E149 even though the tag exists. Solution: Escape `~` as \\\~` so the alias expands to a valid regex (`=\\\~?`) that substring-matches the `expr-=~?` tag. Other `expr-X?` entries are unaffected since they don't contain `~`. * fix(help): don't insert _ before CTRL- when preceded by - Problem: The rule `([^_])CTRL%- -> %1_CTRL-` inserts an underscore between any non-underscore char and `CTRL-`, which wrongly rewrites tags like `map-CTRL-C` and `telnet-CTRL-]` (where `CTRL-` is literal text in the tag, not a key chord). Solution: Exclude `-` from the trigger char class so a hyphen immediately before `CTRL-` is preserved. The existing behavior for `iCTRL-GCTRL-J` -> `i_CTRL-G_CTRL-J` is unaffected because the `G` before `CTRL-J` is not `-`. * fix(help): only treat ^X as caret notation for valid control chars Problem: The regex `%^([^_])` converts any `^X` to `CTRL-X`, including `:set^=` where `^=` is literal text in the tag, not a caret-notation control character. Solution: Restrict the transformation to caret-notation chars (`%a` or one of `?@[\\]^{}`). This matches the C reference behavior where `^X` is only converted when X is alphanumeric or one of the control-notation punctuation chars. `{` is retained so `^{char}` still maps to the `CTRL-{char}` placeholder tag.
* vim-patch:9.2.0821: filetype: msmtp system-wide rc file not detected (#40895)zeertzjq2026-07-21
| | | | | | | | | | | | Problem: filetype: msmtp system-wide rc file not detected (chdiza). Solution: Detect 'msmtprc' as filetype msmtp, like '.msmtprc' (Doug Kearns). fixes: vim/vim#20751 closes: vim/vim#20752 https://github.com/vim/vim/commit/88440f9a3460bf54e4017340e764788dcf6cb3d7 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* fix(lsp): guard linked_editing_range refresh on attach (#40888)Artem Krinitsyn2026-07-21
| | | | | | | | | | Problem: on_attach() calls refresh(), but there is no guarantee the attached buffer is the current buffer. This can make linked editing request handling assume the wrong window. Solution: Call refresh() only if the current buffer is attached. This keeps the initial highlighting behavior while avoiding making incorrect request.
* fix(system): use native path for Windows executables #40885Sanzhar Kuandyk2026-07-21
| | | | | | | | | Problem: When 'shellslash' is set, exepath() returns forward-slashed paths. Passing that path to vim.system() can prevent cmd.exe from launching. Solution: Convert the resolved executable path to native separators before spawning. Add a Windows regression test for cmd.exe with 'shellslash' enabled.
* fix(ui2): preserve Visual mode messages #40828Barrett Ruth2026-07-20
| | | | | | | | | Problem: The existing `showmode` overlay can immediately cover messages emitted while Visual mode is active, including the `g CTRL-G` word count. Solution: Protect Visual mode messages with the existing message delay and temporarily hide the previous last-line overlay until it is restored.
* fix(ui2): position message windows without autocmds (#40867)Barrett Ruth2026-07-20
| | | | Problem: Fix applied in b2bb60d7 does not properly replace the normal command. Solution: Restore normal command with `noautocmd` to resolve #40780.
* fix(lsp): incorrect rendering of markdown codeblock #40861Justin M. Keyes2026-07-20
| | | | | | | | | | | | Problem: LSP hover erroneously drops blank lines before a 4-space-indented codeblock, which is not valid Markdown. This causes incorrect parsing and wrong display. Solution: Fix `split_lines` so that it doesn't drop the blank line just before a 4-space-indented codeblock. fix https://github.com/neovim/neovim/issues/40860
* feat(lua): Iter:count() #40831PinkLea2026-07-20
|
* fix(diagnostic): skip out-of-range lnum in underline handler #40839penglei2026-07-20
| | | | | | | | | | | | | | | | Problem: `vim.diagnostic.handlers.underline.show` throws `E565: Index out of bounds` when it tries to underline a diagnostic whose `lnum` is past the end of the buffer. This happens with stale diagnostics set on an unloaded buffer (e.g. via `bufadd()`) that are drawn only after the buffer is loaded: by then the file on disk can be shorter than the `lnum` the diagnostic carried. File pickers (snacks.nvim) that open files via `bufadd` + `:buffer` hit this whenever an LSP server has already emitted diagnostics for that URI. Solution: Skip diagnostics with an out-of-range `lnum` in the underline handler. Other handlers `M.virtual_text.show()`, `M.signs.show()`, have a similar condition.
* fix(lsp): preview window converted to normal window is auto-closed (#40770)Rocco Vaccone2026-07-19
| | | | | | | | | | | | | Problem: A floating preview window (hover, signature help) converted to a normal window (e.g. with CTRL-W_H or nvim_win_set_config()) is still closed by the open_floating_preview() autocommands, and a later preview may focus or close it as if it were still a float. Solution: When the preview window is no longer floating, remove its auto-close autocommands and stop tracking it as the buffer's floating preview. Closes #36659
* feat(eval): declare more "fast" functions #40834Justin M. Keyes2026-07-19
|
* fix(lua): vim.keycode cleanup #40817Justin M. Keyes2026-07-18
|
* feat(lua): vim.keycode() gets structured parse result #38636altermo2026-07-18
| | | | | | | | | | | | | | | | | Problems: 1. Can't get individual parts of a key-chord separately: modifiers, key. 2. Can't separate a key-combo into individual key-chords. Solution: Enhance `vim.keycode()` to optionally return a structured parse result as a list of key-chords: - `key_raw` the key-chord (problem 2) - `mod` the modifiers of `key_raw` (problem 1) - `key_orig` the key part of the key-chord, only here if differing from `key` (this doesn't solve any of the above mentioned problems, but it may provide useful and it's (in terms of code) free) - `key` a normalized version of `key_orig` (solving problem 1), example(the first is `key_orig` and second is `key`): `lt` and `<`, `Bar` and `|` (in `<C-Bar>`)
* vim-patch:9.2.0788: filetype: hip files are not recognized (#40809)zeertzjq2026-07-18
| | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: hip files are not recognized Solution: Detect *.hip files as hip filetype, include filetype, syntax and indent plugins, update makemenu.vim and synmenu.vim (Young) Round out HIP (Heterogeneous-compute Interface for Portability) support to mirror the existing CUDA files: - autoload/dist/ft.vim: detect the ".hip" extension as filetype "hip" - ftplugin/hip.vim: behave like C++ by sourcing ftplugin/cpp.vim - indent/hip.vim: use cindent, like indent/cuda.vim - makemenu.vim / synmenu.vim: add a Syntax menu entry The syntax/hip.vim file already sources syntax/cpp.vim and adds the HIP-specific keywords, matching syntax/cuda.vim. closes: vim/vim#20773 https://github.com/vim/vim/commit/b3ad239038ff1d3e1708b0027454b2ef6a86a8a2 Co-authored-by: Young <young20050727@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* fix(ui2): avoid ModeChanged in message window #40788Barrett Ruth2026-07-18
|
* vim-patch:9.2.0786: filetype: Containerfile is not recognized (#40807)zeertzjq2026-07-18
| | | | | | | | | | | | | Problem: filetype: Containerfile is not recognized Solution: Detect *.[Cc]ontainerfiles as dockerfile filetype (Omer Tuchfeld) closes: vim/vim#20783 Supported by AI. https://github.com/vim/vim/commit/6b62ae68c6df250019085fea2992399f1477ad4f Co-authored-by: Omer Tuchfeld <omer@tuchfeld.dev>
* docs: misc, remove some old help tags #40214Justin M. Keyes2026-07-18
| | | | | | | | | | - Remove old help tags: they add noise to cmdline completion. Co-authored-by: acehinnnqru <acehinnnqru@gmail.com> Co-authored-by: KangaZero <samuelyongw@gmail.com> Co-authored-by: Simone Ragusa <hi@interrato.dev> Co-authored-by: Chinmay Dalal <~chinmay/public-inbox@lists.sr.ht> Co-authored-by: coyaSONG <66289470+coyaSONG@users.noreply.github.com> Co-authored-by: Olivia Kinnear <git@superatomic.dev>
* fix(restart): distinguish v:exitreason for :restart! #40801Barrett Ruth2026-07-18
|
* feat(completion): support completionList.applyKind #40769glepnir2026-07-17
| | | | | | | | | | | Problem: values from completionList.itemDefaults always replace the item's own commitCharacters and data. Since 3.18 a server can ask for them to be merged instead. Solution: Handle CompletionList.applyKind and advertise applyKindSupport. Drop itemDefaults once folded into the items: get_items() runs twice on the same result and a Merge isn't idempotent. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#completionItemApplyKinds
* refactor(detach): eliminate `nvim__ui_detach` #40793Justin M. Keyes2026-07-17
| | | | | | | | | | | | | | | Problem: `nvim__ui_detach` was added in 85e0559d46c7 in order to implement `detach_others` from Lua. Using Lua in this case is doing more harm than good. Solution: Extract `ui_detach_channel`, which also allows it to be used for the "self detach" path from `ex_detach`. Bonus: the old MSWIN path always called `os_swap_to_hidden_console()`; now `ui_detach_channel` only does so for a stdio channel. For the common stdio TUI this is identical; for a socket UI it's more correct (no parent console to swap).
* feat(ui): ":%detach!" detaches all other UIs #39216Jason Woodland2026-07-17
| | | | | | | Problem: Not easy for one UI to kick the others off a shared Nvim server. Solution: Treat `:%detach` as detach-other-UIs.
* feat(health): rearrange vim.ui.img checks #40782Olivia Kinnear2026-07-17
|
* fix(lsp): capability cleanup #40763jdrouhard2026-07-16
|
* feat(completion): commitCharacters #38417glepnir2026-07-15
| | | | | | | | | Problem: LSP completion commitCharacters are not handled. Typing a commit character (e.g. `.`, `(`, `;`) while a completion item is selected does not accept the item first. Solution: Store commit characters as a flat string in complete-items. Check it before completion stops, accept the match and let the character be inserted normally.
* fix(restart): keep :restart error message concise #40746Olivia Kinnear2026-07-15
|
* Merge #40621 fix(ui2)!: legacy 'ruler' inconsistenciesJustin M. Keyes2026-07-15
|\
| * docs(ui2): deprecate v:echospaceSébastien Hoffmann2026-07-11
| | | | | | | | | | | | The purpose of `v:echospace` was to avoid disruptive "Press ENTER" prompts. Since those are no longer a problem with ui2, the complexity of maintaining it up-to-date is no longer justified.
| * fix(ui2): fix ruler on repeated messagesSébastien Hoffmann2026-07-11
| | | | | | | | | | | | | | | | | | | | Problem: a long message is cropped to keep the ruler visible. But when the message is repeated, it can be written over the ruler, while the repetition indicator "(1)" is still placed just before the ruler, which ends up somewhere inside the message. Solution: currently, long messages are only cropped when setting the 'last' virttext. Make sure this happens after a repeated long message.
| * fix(ui2): correctly crop message at multibyte/multicell characterSébastien Hoffmann2026-07-11
| |
| * fix(ui2): clear showcmd virt_text together with search countSébastien Hoffmann2026-07-11
| | | | | | | | | | | | | | | | | | | | Problem: when the search count is displayed, the showcmd virt_text is set to 11 empty spaces to ensure a consistent distance between search count and ruler, or screen edge in case of noruler. But when the search count is removed to make place for a message, the empty dummy showcmd remains and unnecessarily erases part of the message. Solution: properly remove showcmd together with search count.
| * fix(ui2)!: don't constrain ruler to ru_wid, fix leading item groupSébastien Hoffmann2026-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ui2's ruler is no longer of fixed width, and the internal width variable `ru_wid` now acts as an arbitrary maximum, which is unnecessary because the same can now be achieved transparently with an item group. Furthermore, the old way of setting `ru_wid` with an overloaded subset of the item group syntax leads to a number of inconsistencies. In particular, when the configured ruler expression is reused for including the ruler into the statusline, where the item group syntax is interpreted in the usual way. The fact that this width is set in the `minwid` position is more confusing now that it is a de-facto maximum. Solution: for ui2, constrain the ruler only by half the screen width, which previously was an additional limit relevant on small screens. Skip the special-case treatment of the ruler's leading item group spec, process it like a normal item group. Example: the current fallback ruler expression in the default statusline now actually works for `rulerformat` itself: set rulerformat=%-14.(%l,%c%V%)\ %P because the result can naturally expand to 18 cells instead of being truncated to the default 17 cells, and removing the period after `minwid` doesn't change the result, whereas before, it would unhelpfully lead to setting the fixed ruler width to 14 cells. BREAKING CHANGE: if the user used to set the ruler's fixed width, it will now be treated as minimum instead of a maximum width, which in practice increases backwards-compatibility with ui1 and vim. The main remaining difference is that item groups are right-aligned by default, but backwards-compatibility can be achieved by setting a negative `minwid`, which ui1 and vim ignore. To restore the previous fixed width, specify `maxwid` as well, but this does not work in ui1 and vim. If `rulerformat` contains a `%=` without enclosing item group, it will now expand to fill half the screen width. But in that case, it will already spread out similarly in the new expression-based statusline, so consistency of the ruler in both positions is increased. To simulate the previous default behaviour, wrap it in `%-17.17(...%)`. For best compatibility and reuse with vim, leave out `maxwid` and make `minwid` negative, e.g. `%-20(...%)`. fix https://github.com/neovim/neovim/issues/40247
* | refactor(lsp): unify LspNotify, decor provider for capabilities #40691jdrouhard2026-07-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Every LSP capability that sends a request on a document change to update its state was using its own buffer-local autocmd to do so. That means there is a separate autocmd per buffer per active capability/feature, and the actual code inside the autocmd callback was virtually identical. The same problem occurred for capabilities that had components to draw on the screen that had their own decoration providers. Solution: Introduce a central `LspNotify` autocmd and decoration provider in the capability module itself. New base class methods `on_close` and `on_change` that take a client_id have been provided, for `didClose` and `didOpen`/`didChange` notifications respectively. New base class method `on_win` that takes topline and botline has been provided to add extmarks or perform other work when lines of a buffer are being drawn. The autocmd callback loops through each active capability instance for the buffer and calls a corresponding method with the triggering client_id if it is currently attached to the buffer that triggered the autocmd. The decoration provider just calls on_win for all active capabilities on the buffer. This slightly tweaks folding range to make use of these new client-id specific callbacks.
* |