aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta/api.gen.lua
Commit message (Collapse)AuthorAge
* 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.
* 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()`.
* 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
* 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(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
* 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.
* 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().
* 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(extmark): virt_lines can highlight until EOL #41289Goldpigg2026-08-18
|
* docs: misc, cwd, vimscript.txt #41356Justin M. Keyes2026-08-17
| | | Extract vimscript.txt from repeat.txt
* docs: misc, :bcd, slug()Justin M. Keyes2026-08-06
|
* 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>
* 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>
* 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(marks): :marks completion, list extmarks #40743Justin M. Keyes2026-07-15
| | | | | | | | | Problem: - No UI for listing extmarks. - `:marks` doesn't support cmdline-completion. Solution: - Add completion and extmarks support to `:marks`. - Update `get_buf_local_marks` to include the ":" (prompt-buffer) mark.
* feat(docs): mark optional API parametersJustin M. Keyes2026-07-13
|
* refactor(api): omit optional paramJustin M. Keyes2026-07-13
|
* fix(filetype): ensure directory bufname ends w/ slash sep #40552Barrett Ruth2026-07-10
| | | | | | | | | | | | Problem: `vim.filetype.match()` needs a cheap way to recognize directory buffers without doing filesystem stat work. Solution: Ensure full buffer names for directories end in a trailing slash. Now directory buffers can proceed through the normal 'filetype' path. Note side-effects: session and ShaDa buffer-list restore behavior must be compatible, so those + corresponding tests must be updated.
* fix(api): nvim_win_resize tweaks #40596Justin M. Keyes2026-07-05
|
* Merge #40520 nvim_win_resizeJustin M. Keyes2026-07-05
|\
| * feat(api): add nvim_win_resize()XiaowenHu962026-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ref #6645 Problem: When a window is resized it takes space from the window right/below first, and only falls back to the window left/above when there is no more room. Sometimes a user wants the space to come from a specific direction. Solution: Add nvim_win_resize(win, width, height, {anchor}) which resizes a window with a choosable anchor edge, letting a window grow leftwards or upwards by taking space from the window to the left or above first. The default anchor reproduces nvim_win_set_width()/nvim_win_set_height().
* | refactor: cleanup, docs #40480Justin M. Keyes2026-06-29
| |
* | feat(api): nvim_set_option_value(operation=...) #39849Kyle2026-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `nvim_set_option_value` cannot "update" options similar to `:set opt=`, `:set opt+=`, etc. The Lua impls of "vim.opt" / "vim.o" have incomplete, bespoke reimplementations of those operations. ref #38420 Solution: - Add `operation` param to `nvim_set_option_value`, which may be "set", "append", "prepend", or "remove". - Use this feature to implement `vim.opt` / `vim.o`.
* | feat(cmdwin): implement cmdwin as a normal buf+winJustin M. Keyes2026-06-25
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: cmdwin (the `:q` cmdline buffer) has various limitations which require special-casing all over the codebase. Besides complicating the code, it also breaks async plugins if they try to create buffers/windows after some work is done, if the user happens to open cmdwin at the wrong the moment: Lua callback: …/guh.nvim/lua/guh/util.lua:531: E11: Invalid in command-line window; <CR> executes, CTRL-C quits stack traceback: [C]: in function 'nvim_buf_delete' …/guh.nvim/lua/guh/util.lua:531: in function <…/guh.nvim/lua/guh/util.lua:526> Solution: Just say no to "inception". Reimplement cmdwin as a normal buffer+window. All of the cmdwin contortions (in both core, and innocent plugins) exist literally only to support "inception": recursive cmdwin-in-cmdline-things, like `<c-r>=`, `/`, search-during-substitute, `:input()`, etc. So we just won't support that (though I have a potential plan for that later, which I call "modal parking lot"). The benefit is that plugins, and core, no longer have to care about cmdwin. BONUS: - mouse-drag on vertical separators works (it only worked for horizontal/statusline before) - inccommand-in-cmdwin now works correctly, for free (thus don't need #40077). POTENTIAL FOLLOWUPS - Drop `CHECK_CMDWIN` ("E11: Invalid in command-line window"), allow chaos. - Unify `BUFLOCK_OK` / `LOCK_OK` ? DESIGN: - Eliminate lots of C globals, `EX_CMDWIN`, etc. - `text_locked()` no longer reports true for cmdwin. - cmdwin = a normal window with 'winfixbuf', 'bufhidden=wipe', 'buftype=nofile'. Invariants come from those options rather than special cases throughout the codebase. - `nv_record` for q:/q//q? calls Lua `nlua_call_vimfn("vim._core.cmdwin", …)`. No `K_CMDWIN` / cmdline-reader detour. - `cedit_key` (`c_CTRL-F`) schedules a deferred event that calls `vim._core.cmdwin.open(type, content, pos)` and returns `Ctrl_C` so the in-flight cmdline cancels. Reader state is not serialized; instead the captured `(type, line, col)` is replayed via `nvim_feedkeys(type..line.."<CR>", "nt", …)` after user confirms. - On confirm/cancel: `<CR>` / `<C-C>` calls into Lua which closes the window and re-feeds the cmdline. BREAKING CHANGES: - Expression-register cmdline (`<C-R>=` from insert-mode) no longer supports cmdwin. Same applies to `input()` / `inputlist()` (already covered by `text_locked`). - Usage of cmdwin in macros/mappings will probably break (assuming they ever worked).
* docs: bufadd(), fnameescape() guidance #40378Justin M. Keyes2026-06-23
|
* docs: miscJustin M. Keyes2026-06-11
|
* docs: misc #40126Justin M. Keyes2026-06-08
|
* feat(extmark): virt_lines_overflow "wrap" and "auto"jreidx2026-06-08
| | | | | | Problem: Extmark has support for horizontal scrolling and truncating, but not wrapping. Solution: Extend virt_lines_overflow flags to support "wrap" and "auto" based on proposed changes in #18282.
* perf(redraw): don't redraw hidden windowsLuuk van Baal2026-05-31
| | | | | Problem: Hidden windows are redrawn unnecessarily. Solution: If a window is hidden, don't bother drawing it.
* docs: misc, options, pos/rangeJustin M. Keyes2026-05-30
|
* docs: misc, custom text-object #39877Justin M. Keyes2026-05-20
| | | | | text-object-define is a pattern I found in tpope's plugins (e.g. https://github.com/tpope/vim-jdaddy) which shows an elegant way to define a text-object. (Any mistakes in the example are my fault.)
* fix(api): nvim_exec_autocmds({buf=x}) runs in buffer context #39061Barrett Ruth2026-05-20
| | | | | Problem: `nvim_exec_autocmds({ buf = ... })` matches the target buffer, but callbacks and modelines run with the caller buffer current rather than the target buffer. Solution: Execute the buffered path in prepared target-buffer context and restore the caller afterward.
* refactor: group nvim_buf_call, nvim_win_call tests #39828Justin M. Keyes2026-05-17
|
* feat(api): nvim_buf_call, win_call can has multiple return values #39801bfredl2026-05-17
| | | | | | from the "because we can and it is not much code" department. (diffcount excluding tests is actually negative) fixes https://github.com/neovim/neovim/issues/39636#issuecomment-4397141270
* feat(api): tab-local option scope #39811Justin M. Keyes2026-05-17
| | | | | | | | | | | | | | | | | | Problem: 2d795face6e4 added support for tab-local options ('cmdheight') to `nvim_get_option_value`, but not to: nvim_get_option_info2() nvim_set_option_value(…, { tab = … }) gettabwinvar() Solution: - Update `options.lua` to model tab-local options. Introduce `kOptScopeTab`. - Handle tab scope in the options layer so it works for all options APIs. Note: - No change to `gettabvar()`. Not sure if needed/wanted. fix https://github.com/neovim/neovim/issues/31140
* fix(api): nvim_get_option_value tab-local 'cmdheight' #39259EliWiegman2026-05-16
| | | | | | | Problem: API clients cannot query the tab-local value of 'cmdheight'. Solution: Allow nvim_get_option_value() to accept { tab = <tab-ID> } for 'cmdheight'.
* 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
* 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.
* docs: expand nvim_create_user_command docs #39540Quentin2026-05-07
|
* docs: sort quasi-keysetsJustin M. Keyes2026-04-26
|
* docs: vim.ui.select, miscJustin M. Keyes2026-04-26
|
* feat(treesitter/extmark): support removing a conceal highlight #35087Peter Cardenas2026-04-25
| | | | | | | | | Problem: Cannot remove a `@conceal` highlight when defined in highlights.scm. Solution: Support a `@noconceal` highlight that works similarly to `@nospell` where it overrides the conceal set on the range to remove it. Additionally, can set the conceal metadata field to false for the same behavior.
* feat(api): nvim_echo(percent=nil) means "unknown" progress #39029Peter Cardenas2026-04-24
| | | | | | | Problem: No way to signal "unknown" or "indeterminate" progress percentage. Solution: Treat percent=nil as "indeterminate" percent.
* fix(api): expose fg_indexed/bg_indexed in nvim_get_hl #39210glepnir2026-04-20
| | | | | | | | | Problem: fg_indexed/bg_indexed were dropped from nvim_get_hl output due to a wrong short_keys guard. HL_FG_INDEXED also wasn't cleared in hl_blend_attrs, and HLATTRS_DICT_SIZE was too small. Solution: Remove the short_keys guard, clear HL_FG_INDEXED in hl_blend_attrs, bump HLATTRS_DICT_SIZE to 24, and clarify docs that these flags mean rgb is an approximation of the cterm palette index.
* docs: misc #39045Justin M. Keyes2026-04-18
|
* test: lint naming conventions #39117Justin M. Keyes2026-04-16
| | | | | | | | | | | | Problem: Naming conventions are not automatically checked. Solution: Add a check to the doc generator. Eventually we should extract this somehow, but that will require refactoring the doc generator... Note: this also checks non-public functions, basically anything that passes through `gen_eval_files.lua` and `gen_vimdoc.lua`. And that's a good thing.