aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta/api_keysets.lua
Commit message (Collapse)AuthorAge
* feat(api): nvim_get_autocmds filter by id#31549glepnir2025-01-26
| | | | | | | Problem: nvim_get_autocmds cannot filter by id. Solution: Support it.
* feat(extmark): stack multiple highlight groups in `hl_group`bfredl2025-01-21
| | | | | | | | | 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.
* Merge #31900 from luukvbaal/nvim_echoJustin M. Keyes2025-01-09
|\
| * feat(api): add err field to nvim_echo() optsLuuk van Baal2025-01-09
| | | | | | | | | | | | | | | | 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`.
* | fix(api): nvim_set_decoration_provider callback return type #31912notomo2025-01-08
|/ | | | | 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
* feat(keysets): teach Union and LuaRefOfLewis Russell2024-11-25
|
* feat(float): allow enabling mouse for non-focusable window (#30844)zeertzjq2024-10-20
| | | | Problem: Cannot allow mouse interaction for non-focusable float window. Solution: Add a "mouse" field to float window config.
* feat: get/set namespace properties #28728altermo2024-06-07
| | | | ref https://github.com/neovim/neovim/pull/28432 ref https://github.com/neovim/neovim/issues/28469
* feat(api): add nvim__redraw for more granular redrawingLuuk van Baal2024-05-02
| | | | | | | | | | | 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'.
* revert: "feat(extmarks): subpriorities (relative to declaration order) ↵Gregory Anders2024-05-01
| | | | | | | | | | | | (#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.
* feat(extmark): window scoped extmarkaltermo2024-02-21
| | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor(lua): use a keyset for vim.diff opts parsingbfredl2024-02-13
|
* refactor: rename FloatConfig to WinConfig #27397Will Hopkins2024-02-09
| | | | | `FloatConfig` is no longer used only for floats, so the name is counterintuitive. Followup to #25550
* feat(api): make nvim_open_win support non-floating windows (#25550)Will Hopkins2024-02-01
| | | | Adds support to `nvim_open_win` and `nvim_win_set_config` for creating and manipulating split (non-floating) windows.
* feat(extmarks): subpriorities (relative to declaration order) (#27131)Gregory Anders2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | 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 "_".
* feat(ui): add support for OSC 8 hyperlinks (#27109)Gregory Anders2024-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* refactor(api): give "hl_group" more accurate _meta typebfredl2024-01-22
| | | | | These can either be number or string in lua, so we can specify this directly as "number|string".
* refactor(api): use hl id directly in nvim_buf_set_extmarkglepnir2024-01-20
|
* feat(extmarks): add virt_text_repeat_linebreak flag (#26625)luukvbaal2023-12-26
| | | | | | Problem: Unable to predict which byte-offset to place virtual text to make it repeat visually in the wrapped part of a line. Solution: Add a flag to nvim_buf_set_extmark() that causes virtual text to repeat in wrapped lines.
* feat(ui): completeopt support popup like vimmathew2023-12-16
|
* feat(nvim_open_term): convert LF => CRLF (#26384)Raphael2023-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Unlike termopen(), nvim_open_term() PTYs do not carriage-return the cursor on newline ("\n") input. nvim --clean :let chan_id = nvim_open_term(1, {}) :call chansend(chan_id, ["here", "are", "some", "lines"]) Actual behavior: here are some lines Expected behaviour: here are some lines Solution: Add `force_crlf` option, and enable it by default.
* refactor(api): complete conversion from `Dictionary` to `Dict(opts)` (#26365)Riccardo Mazzarini2023-12-05
|
* feat(extmarks): add 'invalidate' property to extmarksLuuk van Baal2023-11-08
| | | | | | | | Problem: No way to have extmarks automatically removed when the range it is attached to is deleted. Solution: Add new 'invalidate' property that will hide a mark when the entirety of its range is deleted. When "undo_restore" is set to false, delete the mark from the buffer instead.
* docs: miscellaneous doc and type fixes (#25554)Maria José Solano2023-10-10
|
* Merge pull request #25455 from bfredl/highlight_namespace_gettersbfredl2023-10-01
|\ | | | | feat(ui): allow to get the highlight namespace. closes #24390
| * feat(ui): allow to get the highlight namespaceDaniel Steinberg2023-10-01
| |
* | feat(float): support toggle show float windowglepnir2023-09-30
|/
* Merge pull request #25229 from glepnir/20323bfredl2023-09-26
|\ | | | | fix(highlight): add force in nvim_set_hl
| * fix(highlight): add force in nvim_set_hlglepnir2023-09-26
| |
* | fix(float): add fixd optionglepnir2023-09-18
|/
* feat(extmark): support proper multiline rangesbfredl2023-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The removes the previous restriction that nvim_buf_set_extmark() could not be used to highlight arbitrary multi-line regions The problem can be summarized as follows: let's assume an extmark with a hl_group is placed covering the region (5,0) to (50,0) Now, consider what happens if nvim needs to redraw a window covering the lines 20-30. It needs to be able to ask the marktree what extmarks cover this region, even if they don't begin or end here. Therefore the marktree needs to be augmented with the information covers a point, not just what marks begin or end there. To do this, we augment each node with a field "intersect" which is a set the ids of the marks which overlap this node, but only if it is not part of the set of any parent. This ensures the number of nodes that need to be explicitly marked grows only logarithmically with the total number of explicitly nodes (and thus the number of of overlapping marks). Thus we can quickly iterate all marks which overlaps any query position by looking up what leaf node contains that position. Then we only need to consider all "start" marks within that leaf node, and the "intersect" set of that node and all its parents. Now, and the major source of complexity is that the tree restructuring operations (to ensure that each node has T-1 <= size <= 2*T-1) also need to update these sets. If a full inner node is split in two, one of the new parents might start to completely overlap some ranges and its ids will need to be moved from its children's sets to its own set. Similarly, if two undersized nodes gets joined into one, it might no longer completely overlap some ranges, and now the children which do needs to have the have the ids in its set instead. And then there are the pivots! Yes the pivot operations when a child gets moved from one parent to another.
* fix(highlight): add create param in nvim_get_hlglepnir2023-09-09
|
* feat(float): implement footerEvgeni Chasnovski2023-08-26
| | | | | | | | Problem: Now way to show text at the bottom part of floating window border (a.k.a. "footer"). Solution: Allows `footer` and `footer_pos` config fields similar to `title` and `title_pos`.
* docs(lua): the keyset nilocalypsebfredl2023-08-08
| | | | This is needed to give recent LuaLS the right idea about optional fields.
* feat(lua): use keyset type informationbfredl2023-08-07
|
* feat(lua-types): types for vim.api.* (#24523)Lewis Russell2023-08-01