aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta
Commit message (Collapse)AuthorAge
* feat(defaults): drop TAB from 'termpastefilter' #42433Justin M. Keyes3 days
| | | | | | | | Problem: By default, 'termpastefilter' removes TAB chars when pasting to a :terminal. Very annoying, and does not improve "security". Solution: Drop "HT" from the 'termpastefilter' default.
* docs: flow layoutJustin M. Keyes3 days
| | | | | | | | | | Work towards enabling "flow" layout in most `:help` files. Since [tables are supported in help](https://github.com/neovim/tree-sitter-vimdoc#tables), it's now possible to render most help files as ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88) instead of the legacy fixed-width layout. Besides [improved HTML rendering](https://github.com/neovim/neovim/pull/42381#discussion_r4285705739), flow layout will allow `:help` presentation-mode to un-hardwrap text blocks.
* docs: cleanup invalid help sourceJustin M. Keyes3 days
| | | | | | | | | | Work towards enabling "flow" layout in most `:help` files. Since [tables are supported in help](https://github.com/neovim/tree-sitter-vimdoc#tables), it's now possible to render most help files as ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88) instead of the legacy fixed-width layout. Besides [improved HTML rendering](https://github.com/neovim/neovim/pull/42381#discussion_r4285705739), flow layout will allow `:help` presentation-mode to un-hardwrap text blocks.
* docs: cleanup #42395Justin M. Keyes4 days
| | | | | | | | | | Work towards enabling "flow" layout in most `:help` files. Since [tables are supported in help](https://github.com/neovim/tree-sitter-vimdoc#tables), it's now possible to render most help files as ["flow" layout](https://github.com/neovim/neovim/blob/9244da12e400ec0291450a5e9400d995e7a29b83/src/gen/gen_help_html.lua#L86-L88) instead of the legacy fixed-width layout. Besides [improved HTML rendering](https://github.com/neovim/neovim/pull/42381#discussion_r4285705739), flow layout will allow `:help` presentation-mode to un-hardwrap text blocks. https://github.com/neovim/neovim/issues/31825
* docs: cleanup tables, highlights.scm #42381Justin M. Keyes4 days
| | | highlights.scm: `#match` is slow, prefer `#lua-match`.
* fix(docs): listitems with codeblocks #42367Justin M. Keyes5 days
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: - `<` before a listitem (`< - foo`) is not concealed. - Codeblock HTML has extra blank lines. - Codeblock in a listitem ends the listitem, so HTML docs drop the rest of the item and its nesting. Example from `:h nvim_open_win()`: ``` • border: … the double-box style can be specified as: > [ "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ]. < If fewer than eight chars are given, they will be repeated. • bufpos: … tree-sitter-vimdoc v4.1.0: (block (line_li (prefix) (line) (codeblock (code (line))))) (block (line) ; "If fewer…" (line_li (prefix) (line) (line))) ; "bufpos" tree-sitter-vimdoc v4.2.0: (block (line_li (prefix) (line) (codeblock (code (line))) (line)) ; "If fewer…" (line_li (prefix) (line) (line))) ; "bufpos" ``` Solution: - Bump tree-sitter-vimdoc to v4.2.0. https://github.com/neovim/tree-sitter-vimdoc/pull/174 - gen_help_html: get listitem indent from its first line - gen_help_html: don't double codeblock newlines. - highlight query: conceal `<` in `line_li`. - docs: fix doc sources where a blank line was missing after listitems followed by non-listitem text.
* docs: fix invalid vimdoc #42353Justin M. Keyes5 days
|
* fix(api): nvim_set_option_value() "remove" ignores non-adjacent items #42351Justin M. Keyes6 days
| | | | | | | | | | | | | Problem: `nvim_set_option_value('fo', {'c','r','o'}, {operation='remove'})` does nothing on "jcqrol": the items are joined into one `:set-=` value, which only matches a contiguous substring. Removing map keys, e.g. {'eol','space'} from 'listchars', never matches. `vim.opt:remove{…}` inherits this. (Regression from f34ee3da80e8; 429338e74bf4 fixed the case where the flags are adjacent and in order.) Solution: Remove each item separately.
* fix(multicursor): v:cascading during on_key, insert-preview #42319Justin M. Keyes7 days
| | | | | | | | | | | Problem: - `v:cascading` is false during the Insert-mode live-preview. - `vim.on_key()` sees the internal keys of the Visual-selection preview and "zq" steps. Solution: - Set `v:cascading` during the Insert-mode preview. - Don't send internal keys to `on_key` callbacks. - Use `v:cascading` as the source of truth for `mc_replaying()`.
* multicursor: v:cascading #42289Evgeni Chasnovski8 days
| | | | | Problem: No way to check if cascade is in action. Solution: Add `v:cascading` variable.
* feat(api): nvim_chan_set()Justin M. Keyes11 days
| | | | | | | | | | | | | | | | | | | Problem: Only the stdio channel can "own" a server (self-exit on close). After :restart the TUI reconnects over a socket, so the restarted server does not have "self-exit" behavior when the channel closes (e.g. by UI disconnect, host-terminal close, etc.), which leaves a dangling server. Solution: - Introduce `nvim_chan_set`. (`nvim_set_client_info` doesn't fit: exposing it to Lua would require a `channel` param, which is not backwards-compatible, plus it's awkward because it doesn't merge info.) - Broadcast per-channel properties in the "restart" UI event as an opaque dict (a potentially useful pattern for other UI-events in the future). - UIs are expected to restore the channel properties on restart. - `nvim_get_chan_info()` reports "detach". - Remove `nvim__chan_set_detach()`.
* feat(env)!: 'isident' does not affect $NAME parsingJustin M. Keyes2026-10-05
| | | | | | | | | | | | Problem: 'isident' decides how env var names are parsed, which is more "confusing" than "useful": - Changing 'isident' (for 'define' or "\i") can break `$NAME` expansion. - Its default byte ranges let multibyte names work on Windows (`$aあ`) but not Unix (`$é`). Solution: Ignore 'isident' when parsing env var names.
* fix(multicursor): session-end clobbers '< '>; zqgj skips rows #42221Justin M. Keyes2026-10-03
| | | | | | | | | | | | Problem: - At session end, `'< '>` revert to the session-start snapshot, which drops a selection made during the session. And the snapshot may be from another buffer. - `zqgj` skips screen rows: `zq` tries the motion before the steps, and those trial runs advance `w_curswant`. Solution: - Keep the primary's `'< '>` at session-end. - Restore `w_curswant` after the trial runs and after each run of steps.
* fix(display): pad virtual text after listchars eol #41292Langning Zhang2026-10-03
| | | | | | | | | Problem: End-of-line virtual text is drawn directly after a displayed listchars eol character. Solution: Preserve the normal one-cell separator after the eol character. AI-assisted
* Merge #41944 from epithet/stl-hl-scopesJustin M. Keyes2026-09-30
|\
| * feat(statusline): highlight scopesSébastien Hoffmann2026-09-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem 1: many status line sections are automatically hidden when they currently aren't relevant. When such a section contains highlights, the exact pre-section highlighting needs to be reset at the end, otherwise the highlighting of unrelated sections to the right depend on whether the section is hidden or not. And in case of auto-hiding item groups, it might even refuse to hide. Problem 2: when only a part in the middle of a section should deviate from the surrounding highlighting, the section needs knowledge of the highlighting outside in order to reset it, which makes it hard to create self-contained, reusable modules. Problem 3: with nested sections of progressively stacked highlighting changes, the last %$-modifications effectively have to be subtracted when ending a subsection. This can only be done by replaying all the pre-subsection changes from the last %#. Solution: Introduce highlight scopes %#(...%#) that automatically reset pre-scope highlighting at the end. ref #26037 ref #29976 ref #29980 ref #35806 ref #36685
* | refactor(multicursor)!: drop nvim_mcursor #42156Justin M. Keyes2026-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `nvim_mcursor` is not fully baked, and not strongly motivated, currently. The main programmatic interface for cursors is the "nvim.multicursor" extmarks namespace. Solution: Drop `nvim_mcursor`. Add an internal hook so that multicursor can react when extmarks are added to the "nvim.multicursor" namespace. TODO: If extmarks/namespaces are clumsy to work with, we should _fix that_ rather than adding wrappers.
* | fix(api): correct Lua command and completion typesLewis Russell2026-09-28
| | | | | | | | | | | | | | | | | | | | | | Problem: Command inputs and parsed modifiers have different optional fields, and completion window IDs are annotated as floating-point values. Solution: Separate modifier input and return types, correct integer IDs, and update the metadata generators and their output. AI-assisted
* | fix(lua): types for getloclist() signatures #42131glepnir2026-09-28
| | | | | | | | | | Problem: vim.fn.getloclist() is untyped, unlike getqflist(). Solution: Split it into typed list and {what} forms, like getqflist().
* | feat(multicursor): 'follow' option #42095Justin M. Keyes2026-09-27
|/ | | | | | | | Problem: - gQ does not restore follow-mode (q=). - Users/plugins have no way to check if follow-mode is enabled. Solution: Introduce buffer-local 'follow' option.
* vim-patch:5959274: runtime(doc): Tweak documentation stylezeertzjq2026-09-26
| | | | | | | | | | closes: vim/vim#21361 https://github.com/vim/vim/commit/5959274607038bac22e9dde740060ddb748fedfe Omit :h :source-dryrun as it needs changes to port to Nvim anyway. Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* vim-patch:b3a4882: runtime(doc): mention getcellwidths() in setcellwidths()zeertzjq2026-09-26
| | | | | | closes: vim/vim#21362 https://github.com/vim/vim/commit/b3a4882a915634c6031a4b4c8e25d459ac7b4319
* fix(lua): accept nil nosuf in the expand list overloadLewis Russell2026-09-25
| | | | | | | The expand() overload required nosuf even though callers can pass nil. Mark it optional in the source metadata and regenerate the Lua types. AI-assisted
* fix(api): include all supported window border stylesLewis Russell2026-09-25
| | | | | | | | The border metadata omitted the empty string and bold styles accepted by the API. Include both literals and regenerate the Lua types so valid window configurations pass type checking. AI-assisted
* fix(lua): generate explicit overloads for vim.fnLewis Russell2026-09-25
| | | | | | | | | | | | | | | | The generated vim.fn stubs represent overloads as repeated function declarations. EmmyLua merges their return types, so getline(lnum) is inferred as string|string[] even though it always returns a string. Generate one declaration with @overload annotations from the existing __N entries, while keeping separate Vimdoc signatures. Parenthesize the overload return list so types such as (0|-1)[] remain arrays. Correct getline()'s single-line and range signatures, and add typed getqflist() signatures for its entry-list and property-query forms. This lets callers infer quickfix results without local type overrides. AI-assisted
* refactor(charset)!: delete 'isprint' and cleanup 'iskeyword' and friendsbfredl2026-09-22
| | | | | | | | | | | | | In the `enc=utf-8` only world, the 'isprint' option is quite obsolete. The function is only consulted for decoded U+0080 to U+00FF chars whose printability is defined by the unicode charset, just like higher codepoints. Meanwhile, invalid `\x80` to `\xFF` bytes are always unprintable. Disentangle 'iskeyword', 'isfname' and 'isident' from each other by giving them all separate bitsets. Now these can be updated individually. These updaters can back out of errors gracefully, no need for extra panic logic in option[str].c to restore partially updated chartabs.
* fix(options): validate nvim_set_option_value() dry runsLewis Russell2026-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: nvim_set_option_value() with dry_run=true accepts invalid values such as foldmethod='nonsense'. Validation is mixed with side effects in the did_set_* callbacks, so dry runs skip it. Solution: Split value validation out of the did_set_* callbacks into separate validation_cb callbacks. Use these checks for both normal assignments and nvim_set_option_value() dry runs. Keep side effects in did_set_*. Replace direct foldenable/foldlevel assignments in C folding commands with setters. This gives C commands the same OptionSet and synchronization behavior as Lua assignments. Use normal setters for 'tabstop' and 'vartabstop' in :retab so C code indentation and folds based on indentation use the new tab widths. Direct assignments could leave them using the old widths. :retab temporarily turns off 'list' to calculate tab widths. Previously, :retab -1 reported an error and returned without restoring 'list'. Check the argument before turning 'list' off, so an invalid argument leaves the option unchanged. AI-assisted
* docs(lua): v:event field annotations #41963glepnir2026-09-18
|
* fix(filetype): empty 'filetype' skips :setfiletype #41958Justin M. Keyes2026-09-17
| | | | | | | | | | | | | Problem: After `:restart` a restored buffer can have an empty 'filetype'. Lazy LSP setup during the read replays FileType via `:doautoall`, which sets `did_filetype` even though `filetype=''`. :e foo.md :restart :set ft? " filetype= Solution: Set `did_filetype` only if 'filetype' is non-empty.
* vim-patch:9.2.1107: getregionpos() is slow when only the region bounds are ↵Volodymyr Chernetskyi2026-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | needed (#41925) Problem: getregionpos() returns a pair of positions for every line, so obtaining just the outer endpoints of a region costs O(lines); for a 100000 line region that is about 1.4 million list allocations for a result of which the caller keeps two positions. Solution: Add a "bounds" item to {opts} that returns a single pair with the start on the first line and the end on the last line (Volodymyr Chernetskyi). The lines in between do not influence the outer endpoints, so with "bounds" they are not visited at all. The two positions then come from different lines and describe a diagonal of the region rather than its shape; for a blockwise region they are the start of the first line and the end of the last line, not the corners of the block. This is exactly what indexing the full result gives, so the awkward corners are kept as they are, including an empty first line yielding a "col" of 0 for the start while the end keeps its own column. On a 100000 line buffer this takes getregionpos() from about 45 ms to about 0.003 ms per call. closes: vim/vim#21209 https://github.com/vim/vim/commit/2173c3e4eceedc76c4fd7d56cdbfbbd35e9be853
* feat(api): add ev.win to autocmd callback args #39826glepnir2026-09-09
| | | | | | | | Problem: Autocmd callbacks currently have to rely on curwin, which may already have changed by the time they run. This is especially noticeable for WinNew, WinClosed, WinResized and WinScrolled. Solution: Track the window in the autocmd context and expose it as ev.win. Pass it explicitly for the window events that need it.
* vim-patch:9.2.1038: CursorLineFold/Sign highlighting depends on ↵zeertzjq2026-09-08
| | | | | | | | | | | | | | | | 'cursorlineopt' (#41785) Problem: CursorLineFold and CursorLineSign are only applied when 'cursorlineopt' contains "number" or is "both" (Evgeni Chasnovski). Solution: Apply those groups whenever 'cursorline' is set, independent of 'cursorlineopt' (Vrushali Zampalkar). fixes: vim/vim#20480 closes: vim/vim#21112 https://github.com/vim/vim/commit/1f8d3c44c5bd5a3d5032b3fc53e9d3aa1052583c Co-authored-by: Vrushali-Z <zampalkarvasu@gmail.com>
* vim-patch:0ed11ba: runtime(doc): Tweak documentation style a bitJan Edmund Lazo2026-09-06
| | | | | | https://github.com/vim/vim/commit/0ed11ba223ec69dfefc8cc5800fb3e0d610fd9f8 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* vim-patch:ca2e65a: runtime(doc): Update quickfix help text with missing ↵zeertzjq2026-09-07
| | | | | | | | | | | | information closes: vim/vim#21229 Supported by AI. https://github.com/vim/vim/commit/ca2e65a842d93bd6e3f433ce36b55ec450a2bb1a Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* fix(statusline): default 'statusline' improvements #41597Sébastien Hoffmann2026-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: there should be exactly one cell of padding between sections, and exactly one cell of minimum padding between the left and the right. - Spaces between sections waste space when a section is empty. According to a comment in #33036, this was the reason to avoid `%k` and implement the keymap section with a vim expression, but other sections still have this problem. - The diagnostics section wastes space because it is not entirely empty when there are diagnostics in another buffer. - The terminal exit code section can touch the right side, e.g. the ruler, even though it belongs to the left side. Solution: - Use auto-hiding item groups (`%(` without width fields) to get rid of unneeded spaces when a section shows no information. This simplifies the 'showcmd' and 'keymap' sections in particular. - As a slight simplification, `term_exitcode` is moved into the flags section since it is formatted with square brackets like a flag. - Count the diagnostics for the current buffer specifically. - Ensure at least one cell of padding between the left and the right side by adding a space next to the separator `%=`. Problem: some sections are implemented with `%{%`, even though reevaluation of the expression result is not needed. This leads to otherwise needless %-escaping in `progress_status`. Solution: use `%{` instead. Problem: `%{` and `%{%` (without items) replace spaces with fillchars. This looks out-of-place inside the terminal exit code section, and in contrast to all other sections, the 'busy' section is surrounded by fillchars, which looks inconsistent, and with some terminal-font combinations, ◐ overlaps the fillchar, e.g. Alacritty & JetBrains Mono. Solution: use non-breaking spaces U+202F to avoid fillchar substitution. Problem: sections that appear/disappear frequently can make otherwise more stable sections jump around a lot. Solution: sort the sections on the right roughly by volatility: 'showcmd' in first place, 'keymap' next to the ruler.
* vim-patch:fac9e33: runtime(doc): fix example output of cosh (#41609)zeertzjq2026-09-02
| | | | | | | closes: vim/vim#21197 https://github.com/vim/vim/commit/fac9e333a8d38e7049e6628e0f5157f4b7c44d2c Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
* feat(multicursor): MC HAMMER #41587Justin M. Keyes2026-09-01
| | | | | | | | | | | | | | | | | | | | | Other (squashed) commits: fix(tui): emit ui_send output atomically with the frame Problem: tui_ui_send() writes directly to the TTY, bypassing the output buffer. Sequences sent via nvim_ui_send() (e.g. kitty multiple-cursors, or visual-dot-repeat) always arrive in a separate TTY write from the frame they were computed for. This manifests as "tearing", or e.g. in the case of multicursor the terminal renders text with stale cursor overlays. Solution: - tui_ui_send(): while a frame is being assembled (pending invalid regions or buffered output), buffer instead of writing directly. - Out-of-frame sends (tty queries, clear-on-disable) still write immediately. - mcursor.lua: emit the terminal-cursor update at the end of the redraw cycle (`on_end`, when screen positions are final) instead of vim.schedule().
* vim-patch:9.2.1004: a completion function cannot tell why it was called (#41500)zeertzjq2026-08-26
| | | | | | | | | | | | | | | Problem: A function used through 'omnifunc' or 'complete' is called the same way whether 'autocomplete' started the completion or a key asked for one, so it cannot answer differently. Solution: Report which of the two it is in complete_info() as "auto". It is returned only when asked for in {what}, so what complete_info() says by itself does not change (Hirohito Higashi). closes: vim/vim#21143 https://github.com/vim/vim/commit/1f56c351dedad288f79c89b6b6f64be762ec3b9b Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* feat(ui2): lift ui2 options into 'messagesopt' (part 1) #41474Justin M. Keyes2026-08-25
| | | | | | | | | | | | | | | | | | | Problem: In order for ui2 to graduate to the main "messages ui" its configuration needs to graduate into actual options. Solution: Migrate some of its config to 'messagesopt': - "maxheight" (note: currently this is an integer treated as a "percentage"; if we want to support a row count we could allow values with units, like `"42%"`) - "pager" - "timeout" Also improves error messages: messagesopt=hit-enter,history:500,bogus E474: Unknown item 'bogus' messagesopt=hit-enter,history:500,progress:x E474: 'progress' must be one of: , c messagesopt=hit-enter,history:abc E474: 'history' requires a number
* vim-patch:9.2.1001: complete_info() does not report the item highlight ↵glepnir2026-08-24
| | | | | | | | | | | | groups (#41461) Problem: complete_info() omits "abbr_hlgroup" and "kind_hlgroup". Solution: Keep the highlight group ID with the match instead of the resolved attribute and add both entries to the returned items (glepnir). closes: vim/vim#21105 https://github.com/vim/vim/commit/1c32cede0afdc9351d5887e2f25977d4fb964d9f
* vim-patch:63d08d4: runtime(doc): update :h write-plugin and readdir() examplezeertzjq2026-08-24
| | | | | | | | | | | | | | | | | | | | 1) The complete example plugin at :h write-plugin the end of the documentation didn't reflect the snippets provided during the tutorial. In most of the Add() function, interpolated strings are used, but the final result used concatenated strings. 2) The example provided in readdir() to get a list of files ending in ".txt" didn't properly escape the dot in the regular expression: readdir(dirname, {n -> n =~ '.txt$'}) This would match any file ending with "txt" that is at least 4 characters long, instead it should be: readdir(dirname, {n -> n =~ '\.txt$'}) closes: vim/vim#21123 https://github.com/vim/vim/commit/63d08d43862ed195da78cfb1bebe2c0ed02f80b7 Co-authored-by: Josep Puigdemont <josep.puigdemont@gmail.com>
* docs: misc #41452Justin M. Keyes2026-08-23
| | | | | Co-authored-by: darkdi <rantovov5@gmail.com> Co-authored-by: Qiaoxi Guo <28090444+breadtitor@users.noreply.github.com> Co-authored-by: zaveshaa <zaveshaa@gmail.com>
* feat(cmdatom): mappings capture continuationJustin M. Keyes2026-08-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: A mapping that ends mid-operation (`nnoremap ,D d`) emits a content-free "mapping" atom plus a `pending` field, and the "continuation" motion arrives as a sibling atom. Consumers must stitch the two together (which has broken cases, e.g. Insert-opening mappings (",i") lose their session entirely). - ",i": the session atom is dropped bc the mapping RHS is consumed before the session starts (typebuf_maplen()==0), so atom_is_user_input()=false. - ":normal"-in-opfunc: the opfunc internal "v..y" session (a) became kVatomTyped just because the deferred composite was open, masking the real operator capture via atom_captures, and (b) its nested frames re-derived the outer redo. - "Motion" based on `moved=true`, has false negatives. - `CmdAtom.remap` is unnecessary, and clutters the docs/usage. Solution: - Introduce `frame_id` to identify CmdFrames. - Classify `type=motion` better, via `NV_MOTION` flag on the `nv_cmds` table. - Drop `CmdAtom.pending`, `CmdAtom.remap`. - Defer atom_composite_end() at the clock edge while an operator is pending, Visual is active, or `restart_edit` is set: the composite keeps collecting, so the continuation is captured in the mapping atom. - ",i": Now an open composite counts as user input. - ":normal"-in-opfunc: Now handled correctly. - `remap` is now decided by `composite.payload || 0 subatoms`. atom_payload_mark() records the read the resolution never captures. - `toplevel` is now decided by `CmdFrame.parent == NULL`. before/after: INPUT BEFORE AFTER --------------------------------------------------------------------- ,D w {mapping lhs=,D pending=operator} {operator lhs=,Dw keys=dw} + {operator keys=dw} ysiw" {mapping lhs=ys pending=operator} {operator lhs=ysiw" keys=g@iw"} + {operator lhs=g@iw"} ,v d {mapping pending=visual} {visual lhs=,vd keys=viwd} + {visual lhs=viwd} ,i XY<Esc> {normal keys=i lhs=,iXY<Esc>} {insert keys=1iXY<Esc> text=XY}
* feat(cmdatom)!: eliminate the need for vim-repeat #41414Justin M. Keyes2026-08-21
| | | | |