summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_meta/api_keysets.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-14fix(lua): not obvious which _meta/ files are generated #39035Justin M. Keyes1
Problem: - Not obvious which _meta/ are generated and which should be edited manually. - The require guard (`error('Cannot require a meta file')`) is not consistently present in all meta files. Solution: - Update headers. - Add require() guard to all meta files. - Rename generated meta files with `.gen.lua`.
2026-04-12feat(api): nvim_set_hl can set "font" #37668glepnir1
Problem: Cannot set highlight group fonts via API, only via :highlight command. Solution: Add font parameter in nvim_set_hl().
2026-04-12fix(api): nvim_get_hl drops groups defined with link_global #38492glepnir1
Problem: hlgroup2dict passes &ns_id to ns_get_hl twice. The first call (link=true) sets *ns_hl = 0 when link_global is set, so the second call and the sg_cleared guard both see ns_id == 0 and bail out. The group is silently dropped from the result. Solution: use a temporary copy of ns_id for each ns_get_hl call so the original value is preserved.
2026-04-09fix(messages): truncate warning messages only in display (#38901)zeertzjq1
For now, add a private "_truncate" flag to nvim_echo, using a truncation method similar to showmode().
2026-04-08feat(api): rename buffer to buf #35330Jordan1
Problem: `:help dev-name-common` states that "buf" should be used instead of "buffer" but there are cases where buffer is mentioned in the lua API. Solution: - Rename occurrences of "buffer" to "buf" for consistency with the documentation. - Support (but deprecate) "buffer" for backwards compatibility. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-27feat(progress): set Progress-event pattern to "source" #38495Shadman1
Problem: Currently, there's no way to distinguish progress messages coming from different sources. Nor can Progress event be easily filtered based on source. Solution: - Add "source" field to nvim_echo-opts. - The Progress event pattern is now defined by the "source" field. - Include the "title" as ev.data. - Unrelated change: set force=false to disable nesting.
2026-03-25feat(api): nvim_set_hl{update:boolean} #37546glepnir1
Problem: nvim_set_hl always replaces all attributes. Solution: Add update field. When true, merge with existing attributes instead of replacing. Unspecified attributes are preserved. If highlight group doesn't exist, falls back to reset mode.
2026-03-16fix(api): nvim_open_tabpage positional "enter"Sean Dewar1
Problem: nvim_open_tabpage's "enter" argument is optional, which is inconsistent with nvim_open_win. Solution: make it a (non-optional) positional argument, like nvim_open_win. Also change "enter"'s description to be more like nvim_open_win's doc.
2026-03-16feat(api): add nvim_open_tabpageWill Hopkins1
Problem: no API function for opening a new tab page and returning its handle, or to open without entering. Solution: add nvim_open_tabpage.
2026-03-03fix(api): return "style" in nvim_win_get_config() #38122Sean Dewar1
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)
2026-02-26vim-patch:9.2.0061: Not possible to know when a session will be loaded (#38071)zeertzjq1
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>
2026-02-23fix(api): win_config `border` type #38030glepnir1
Problem: ArrayOf(String) doesn't cover mixed string/array border chars. Solution: use Union(Array, Enum(...)) to match parse_border_style behavior.
2026-02-21docs: highlight, terminal SGR #37998Justin M. Keyes1
2026-02-20feat(highlight): support more SGR attributes #37901Riccardo Mazzarini1
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.
2026-02-10fix(api): cterm type in highlight keyset #37802glepnir1
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.
2026-01-20vim-patch:9.1.1202: Missing TabClosedPre autocommandzeertzjq1
Problem: Missing TabClosedPre autocommand (zoumi) Solution: Add the TabClosedPre autcommand (Jim Zhou). fixes: vim/vim#16518 closes: vim/vim#16855 https://github.com/vim/vim/commit/5606ca5349982fe53cc6a2ec6345aa66f0613d40 Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
2026-01-16vim-patch:9.1.0059: No event triggered before creating a windowzeertzjq1
Problem: No event is triggered before creating a window. (Sergey Vlasov) Solution: Add the WinNewPre event (Sergey Vlasov) fixes: vim/vim#10635 closes: vim/vim#12761 https://github.com/vim/vim/commit/1f47db75fdc8c53c5c778b26ecfa0942ac801f22 Not sure if this should be triggered before creating a floating window, as its use case is related to window layout. Co-authored-by: Sergey Vlasov <sergey@vlasov.me>
2025-12-07feat(events): MarkSet event, aucmd_defer() #35793Nathan Smith1
Problem: - Can't subscribe to "mark" events. - Executing events is risky because they can't be deferred. Solution: - Introduce `MarkSet` event. - Introduce `aucmd_defer()`. Helped-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-11-26feat(float): 'statusline' in floating windows #36521glepnir1
Problem: Can't show 'statusline' in floating windows. Solution: Use window-local 'statusline' to control floating window statusline visibility.
2025-09-09fix(treesitter): use subpriorities for tree orderingbfredl1
This partially reverts 0b8a72b73934d33a05e20c255298e88cd921df32, that is unreverts 15e77a56b711102fdc123e15b3f37d49bc0b1df1 "priority" is an internal neovim concept which does not occur in shared queries. Ideally a single priority space should eventually be enough for our needs. But as we don't want to poke at the usages of priorities right now in the wider ecosystem, introduce the "subpriorities" so that treesitter code can distinguish highlights of the same priorities with different tree nesting depth. This mainly affects `injection.combined` as parent-tree nodes might appear in the middle of child-tree nodes which otherwise is not possible.
2025-08-28perf: add on_range in treesitter highlightingvanaigr1
2025-08-26feat(api): nvim_echo can emit Progress messages/events #34846Shadman1
Problem: Nvim does not have a core concept for indicating "progress" of long-running tasks. The LspProgress event is specific to LSP. Solution: - `nvim_echo` can emit `kind="progress"` messages. - Emits a `Progress` event. - Includes new fields (id, status, percent) in the `msg_show` ui-event. - The UI is expected to overwrite any message having the same id. - Messages have a globally unique ID. - `nvim_echo` returns the message ID. - `nvim_echo(… {id=…})` updates existing messages. Example: local grp = vim.api.nvim_create_augroup("Msg", {clear = true}) vim.api.nvim_create_autocmd('Progress', { pattern={"term"}, group = grp, callback = function(ev) print(string.format('event fired: %s', vim.inspect(ev))..'\n') end }) -- require('vim._extui').enable({enable=true, msg={target='msg', timeout=1000}}) vim.api.nvim_echo({{'searching'}}, true, {kind='progress', percent=80, status='running', title="terminal(ripgrep)"}) local id = vim.api.nvim_echo({{'searching'}}, true, {kind='progress', status='running', percent=10, title="terminal(ripgrep)"}) vim.api.nvim_echo({}, true, {id = id, kind='progress', percent=20, status = 'running', title='find tests'}) vim.api.nvim_echo({}, true, {id = id, kind='progress', status='running', percent=70}) vim.api.nvim_echo({{'complete'}}, true, {id = id, kind='progress', status='success', percent=100, title="find tests"}) Followups: - Integrate with 'statusline' by listening to the Progress autocmd event. - Integrate progress ui-event with `vim._extui`.
2025-07-12docs(autocmd): generate events enum type #34883luukvbaal1
2025-07-07docs: type fixes #34831phanium1
2025-06-26docs(api): document types using LuaCATS typesLewis Russell1
- Render Lua types in api.txt. - Added `DictAs(name)` API type which acts the same as `Dict` (no parens) when generating the dispatchers, but acts the same as `Dict(name)` when generating docs. - Added `Tuple(...)` API type which is the treated the as `Array` for generating the dispatchers, but is used to document richer types. - Added `Enum(...)` API type to better document enums - Improve typing of some API functions. - Improve c_grammar to properly parse API types and replace string pattern logic in the parsers. - Removed all the hardcoded type overrides in gen_eval_files.lua
2025-05-27feat(api): set nvim_echo() kind for ext_messages (#33998)luukvbaal1
Problem: Unable to emit a message with arbitrary kind. Solution: Add a "kind" opts field to nvim_echo(). Use it to set the "list_cmd" kind for vim.show_pos().
2025-04-29feat(ui): use builtin completion popupmenu with ext_cmdline (#31269)luukvbaal1
Problem: UIs implementing ext_cmdline/message must also implement ext_popupmenu in order to get cmdline completion with wildoptions+=pum. Solution: Allow marking a window as the ext_cmdline window through nvim_open_win(), including prompt offset. Anchor the cmdline- completion popupmenu to this window.
2025-04-21feat(api): add "max_height" argument to nvim_win_text_height (#32835)luukvbaal1
Useful to e.g. limit the height to the window height, avoiding unnecessary work. Or to find out how many buffer lines beyond "start_row" take up a certain number of logical lines (returned in "end_row" and "end_vcol").
2025-03-10fix(lua): types for vim.api.keyset.win_config #32700Tomasz N1
2025-02-25feat(treesitter): vertical conceal support for highlighterLuuk van Baal1
TSHighlighter now places marks for conceal_lines metadata. A new internal decor provider callback _on_conceal_line was added that instructs the highlighter to place conceal_lines marks whenever the editor needs to know whether a line is concealed. The bundled markdown queries use conceal_lines metadata to conceal code block fence lines.
2025-02-25feat(marks): add conceal_lines to nvim_buf_set_extmark()Luuk van Baal1
Implement an extmark property that conceals lines vertically.
2025-02-20feat(marks): virtual lines support horizontal scrolling (#32497)zeertzjq1
Add a new field `virt_lines_overflow` that enables horizontal scrolling for virtual lines when set to "scroll".
2025-01-26feat(api): nvim_get_autocmds filter by id#31549glepnir1
Problem: nvim_get_autocmds cannot filter by id. Solution: Support it.
2025-01-21feat(extmark): stack multiple highlight groups in `hl_group`bfredl1
This has been possible in the "backend" for a while but API was missing. Followup: we will need a `details2=true` mode for `nvim_get_hl_id_by_name` to return information in a way forward compatible with even further enhancements.
2025-01-09Merge #31900 from luukvbaal/nvim_echoJustin M. Keyes1
2025-01-09feat(api): add err field to nvim_echo() optsLuuk van Baal1
Problem: We want to deprecate `nvim_err_write(ln)()` but there is no obvious replacement (from Lua). Meanwhile we already have `nvim_echo()` with an `opts` argument. Solution: Add `err` argument to `nvim_echo()` that directly maps to `:echoerr`.
2025-01-08fix(api): nvim_set_decoration_provider callback return type #31912notomo1
Problem: incorrect return type doc causes luals `Annotations specify that at most 0 return value(s) are required, found 1 returned here instead.` diagnosis Solution: correct return type doc
2024-11-25feat(keysets): teach Union and LuaRefOfLewis Russell1
2024-10-20feat(float): allow enabling mouse for non-focusable window (#30844)zeertzjq1
Problem: Cannot allow mouse interaction for non-focusable float window. Solution: Add a "mouse" field to float window config.
2024-06-07feat: get/set namespace properties #28728altermo1
ref https://github.com/neovim/neovim/pull/28432 ref https://github.com/neovim/neovim/issues/28469
2024-05-02feat(api): add nvim__redraw for more granular redrawingLuuk van Baal1
Experimental and subject to future changes. Add a way to redraw certain elements that are not redrawn while Nvim is waiting for input, or currently have no API to do so. This API covers all that can be done with the :redraw* commands, in addition to the following new features: - Immediately move the cursor to a (non-current) window. - Target a specific window or buffer to mark for redraw. - Mark a buffer range for redraw (replaces nvim__buf_redraw_range()). - Redraw the 'statuscolumn'.
2024-05-01revert: "feat(extmarks): subpriorities (relative to declaration order) ↵Gregory Anders1
(#27131)" (#28585) This reverts commit 15e77a56b711102fdc123e15b3f37d49bc0b1df1. Subpriorities were added in https://github.com/neovim/neovim/pull/27131 as a mechanism for enforcing query order when using iter_matches in the Tree-sitter highlighter. However, iter_matches proved to have too many complications to use in the highlighter so we eventually reverted back to using iter_captures (https://github.com/neovim/neovim/pull/27901). Thus, subpriorities are no longer needed and can be removed.
2024-02-21feat(extmark): window scoped extmarkaltermo1
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-02-13refactor(lua): use a keyset for vim.diff opts parsingbfredl1
2024-02-09refactor: rename FloatConfig to WinConfig #27397Will Hopkins1
`FloatConfig` is no longer used only for floats, so the name is counterintuitive. Followup to #25550
2024-02-01feat(api): make nvim_open_win support non-floating windows (#25550)Will Hopkins1
Adds support to `nvim_open_win` and `nvim_win_set_config` for creating and manipulating split (non-floating) windows.
2024-01-28feat(extmarks): subpriorities (relative to declaration order) (#27131)Gregory Anders1
The "priority" field of extmarks can be used to set priorities of extmarks which dictates which highlight group a range will actually have when there are multiple extmarks applied. However, when multiple extmarks have the same priority, the only way to enforce an actual priority is through the order in which the extmarks are set. It is not always possible or desirable to set extmarks in a specific order, however, so we add a new "subpriority" field that explicitly enforces the ordering of extmarks that have the same priority. For now this will be used only to enforce priority of treesitter highlights. A single node in a treesitter tree may match multiple captures, in which case that node will have multiple extmarks set. The order in which captures are returned from the treesitter API is not _necessarily_ in the same order they are defined in a query file, so we use the new subpriority field to force that ordering. For now subpriorites are not documented and are not meant to be used by external code, and it only applies to ephemeral extmarks. We indicate the "private" nature of subpriorities by prefixing the field name with an "_".
2024-01-24feat(ui): add support for OSC 8 hyperlinks (#27109)Gregory Anders1
Extmarks can contain URLs which can then be drawn in any supporting UI. In the TUI, for example, URLs are "drawn" by emitting the OSC 8 control sequence to the TTY. On terminals which support the OSC 8 sequence this will create clickable hyperlinks. URLs are treated as inline highlights in the decoration subsystem, so are included in the `DecorSignHighlight` structure. However, unlike other inline highlights they use allocated memory which must be freed, so they set the `ext` flag in `DecorInline` so that their lifetimes are managed along with other allocated memory like virtual text. The decoration subsystem then adds the URLs as a new highlight attribute. The highlight subsystem maintains a set of unique URLs to avoid duplicating allocations for the same string. To attach a URL to an existing highlight attribute we call `hl_add_url` which finds the URL in the set (allocating and adding it if it does not exist) and sets the `url` highlight attribute to the index of the URL in the set (using an index helps keep the size of the `HlAttrs` struct small). This has the potential to lead to an increase in highlight attributes if a URL is used over a range that contains many different highlight attributes, because now each existing attribute must be combined with the URL. In practice, however, URLs typically span a range containing a single highlight (e.g. link text in Markdown), so this is likely just a pathological edge case. When a new highlight attribute is defined with a URL it is copied to all attached UIs with the `hl_attr_define` UI event. The TUI manages its own set of URLs (just like the highlight subsystem) to minimize allocations. The TUI keeps track of which URL is "active" for the cell it is printing. If no URL is active and a cell containing a URL is printed, the opening OSC 8 sequence is emitted and that URL becomes the actively tracked URL. If the cursor is moved while in the middle of a URL span, we emit the terminating OSC sequence to prevent the hyperlink from spanning multiple lines. This does not support nested hyperlinks, but that is a rare (and, frankly, bizarre) use case. If a valid use case for nested hyperlinks ever presents itself we can address that issue then.
2024-01-22refactor(api): give "hl_group" more accurate _meta typebfredl1
These can either be number or string in lua, so we can specify this directly as "number|string".
2024-01-20refactor(api): use hl id directly in nvim_buf_set_extmarkglepnir1