aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua.txt
Commit message (Collapse)AuthorAge
...
* docs: misc, options, pos/rangeJustin M. Keyes2026-05-30
|
* feat(lua): support table `lhs` in vim.keymap.set()/del() #39948Olivia Kinnear2026-05-29
| | | | | | | | | | | | | | | | | Problem: It is repetitive to map multiple keymaps to do the same thing. Here are some cases where being able to do this would be useful: -- Visual movement for both j/k and down/up: vim.keymap.set({ 'n', 'x' }, { 'j', '<Down>' }, 'v:count == 0 ? "gj" : "j"', { expr = true }) vim.keymap.set({ 'n', 'x' }, { 'k', '<Up>' }, 'v:count == 0 ? "gk" : "k"', { expr = true }) -- Map multiple keys to `<Nop>` concisely: vim.keymap.set({ 'n', 'x' }, { '<Leader>', '<Localleader>', '<CR>' }, '<Nop>') -- Remove multiple keymaps at once: vim.keymap.del('n', { 'gri', 'grn', 'grr' }) Solution: Support the `lhs` of `vim.keymap.set()` and `vim.keymap.del()` being a table, in the same way that `modes` can be.
* refactor(docs): generate tui.txt $NVIM_TERMDEFS keys #39836Kyle2026-05-21
| | | | | | | | | Problem: Potential documentation drift in `tui.txt` if fields for `$NVIM_TERMDEFS` change. Solution: Generate docs for `tui.txt`. Add `brief_xform` to `gen_vimdoc.lua` to allow transforming briefs during generation.
* refactor(pos,range): add missing validators and improve the docsYi Ming2026-05-20
| | | | | | | | | | | Problem: Our documentation is incomplete or inconsistent in several ways: - Some public APIs lack corresponding validators. - Some public APIs lack usage examples. - The meaning of some return values or parameters is not clearly explained. Solution: Add the missing validators, examples, and clarifications.
* feat(pos,range)!: remove `range.cursor()` and `range:to_cursor()`,Yi Ming2026-05-20
| | | | | | | | | | | | | Problem: - A window can only have one cursor, ranges selected by the cursor are typically obtained by marks like ">" and "<", instead of calling get_cursor() twice. - `vim.Range` is described as end-exclusive, but the current `range.cursor()`/`range:to_cursor()` are end-inclusive. - Conversion between `vim.Range` and mark-indexed range can be done by `range.mark()`/`range:to_mark()` Solution: Remove `range.cursor()` and `range:to_cursor()`,
* Merge #39822 from ofseed/pos-markJustin M. Keyes2026-05-18
|\ | | | | feat(pos,range): pos:to_mark(), pos.mark(), range:to_mark(), range.mark()
| * feat(pos,range): pos:to_mark(), pos.mark(), range:to_mark(), range.mark()Yi Ming2026-05-18
| | | | | | | | | | | | | | | | | | Problem: Ranges represented by marks are usually end-inclusive, but the range utilities we provided are end-exclusive. Solution: Add pos:to_mark(), pos.mark(), range:to_mark(), and range.mark().
* | docs: misc, $NVIM_TERMDEFSJustin M. Keyes2026-05-18
|/
* feat(ui): vim.ui.input(opts.scope) #39570Evgeni Chasnovski2026-05-17
| | | | | | | | | | | | | | | Problem: There is no way for a `vim.ui.input` caller to indicate for which scope the input is. As in "This input is for something at cursor scope". This information can be useful for `vim.ui.input` implementation to tweak its behavior and presentation: - Show different floating window depending on the scope. For example: - Near cursor for "cursor" scope. - At line start for "line" scope. - In window corner for "buffer" and "window" scopes. - In whole editor corner for "tabpage", "editor", "project" scopes. - Navigate through history only for inputs with the same scope. Solution: Document new `opts.scope` for `vim.ui.input`. Use it in the codebase.
* feat(vim.hl): vim.hl.hl_op() #39777Ayose C.2026-05-17
| | | | | | | | Problem: vim.hl.on_yank() only works for TextYankPost, not TextPutPost. Solution: Introduce hl_op(). Deprecate on_yank().
* fix(ui2): unable to configure window height of absolute 1 #39781luukvbaal2026-05-14
| | | | | | | | | | | | Problem: - Configuring the height of one of the message targets to 1 is recognized as 100% of 'lines'. - Cmdline is expanded for message exceeding 'cmdheight' even if the configured height is smaller than or equal to 'cmdheight'. Solution: - Recognize a height of 1 as absolute; a decimal number smaller than 1 is taken as a fraction of 'lines' (replace 1 with 0.999 for the old behavior). - Don't expand the cmdline if the configured height doesn't allow it.
* refactor(vim.fs): deduplicate by using vim.fn #39782Justin M. Keyes2026-05-14
| | | | | | | | | | | | | | Problem: 61e99217e684 replaced usages of `vim.fn`. This duplicates non-trivial logic and may have introduced bugs like 38e38d1b401e. Later on, b02eeb6a7281 graduated `fnamemodify` to `fast`, so avoiding it in `vim.fs` is no longer necessary. Solution: Use `vim.fn` to deduplicate `vim.fs.dirname()` and `vim.fs.basename()`. Note: the "nvim -l" test-runner switch from the original PR (#30483) is already done by 9432e6c1e2e9 (#39676).
* fix(ui2): unable to route by message ID #39734luukvbaal2026-05-11
| | | | | | | | | | | | | | | | | | | | | Problem: - "bufwrite" message identifier is encoded in the message ID of a "progress" kind message (since ff68fd6b); UI2 does not allow routing by message ID. - No documented way to set a default message target for all but a few kinds (without copying all of |ui-messages| kinds to cfg.msg.targets). - A user adding a message route for the documented empty "" kind can result in unexpected behavior. - Showing duplicate message (x) indicator in msg and cmd targets simultaneously is unsupported. - Manually triggering CursorMoved autocommand to add matchparen highlighting in the cmdline. Solution: - Match cfg.msg.targets keys as Lua pattern to a message ID. - Recognize "default" as key in cfg.msg.targets, drop the undocumented cfg.msg.target field. - Don't try to get configured target for "" message kind/trigger. - Maintain msg indicator virtual text for the cmd and msg target. - Add matchparen highlighting by directly calling the Lua module (possible since b813c7e0).
* fix(lua): vim.wait(0) does not call loop_poll #39679Justin M. Keyes2026-05-10
| | | | | | | | | | | Problem: Regression from c822a2657c78: `vim.wait(0)` does not call `loop_poll`, so `vim.wait(1)` is needed to "yield" from Lua. Solution: - Ensure that `vim._core.loop_poll()` is always called, even when `time=0`. - Document how to interrupt Lua code (ctrl-c). ref https://github.com/neovim/neovim/issues/6800
* feat(logging): vim.log #38906Yi Ming2026-05-10
|
* fix(snippet): cancel session on <Esc> in Select mode #39238glepnir2026-05-10
| | | | | | | Problem: <Esc> in a Select-mode tabstop leaves the session and highlight active. CursorMoved isn’t triggered since the cursor doesn’t move. Solution: use ModeChanged (s:n) instead. Defer with vim.schedule() to avoid transient s:n from jump().
* 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.
* feat(pos): pos:to_offset(), pos.offset() #39564Yi Ming2026-05-06
| | | | | | | | | | | | | | | | | | | Problem: For a given position, it is not easy to compare which of several other positions is closest to it. Solution: Add support for converting `vim.Pos` to a buffer byte offset. This allows for sorting, e.g: ```lua table.sort(positions, function(pos1, pos2) return pos1:to_offset() < pos2:to_offset() end ``` Or a binary search, e.g: ```lua vim.list.bisect(positions, pos, { key = function(pos) return pos:to_offset() end }) ```
* Merge #39630 from ofseed/lua-no-memoizeJustin M. Keyes2026-05-06
|\
| * revert: "perf(lua): memoize `key_fn` results"Yi Ming2026-05-06
| | | | | | | | This reverts commit 83947752412d55fc089a45549bb51ec0863f55fa.
* | fix(vim.iter): add richer generic annotationsLewis Russell2026-05-06
|/ | | | | | | | | | | | Improve the vim.iter annotations with richer generics that track element and tuple types through iterator pipelines, including multi-value stages and list-specific methods. Extend the LuaCATS parser and vimdoc generator so those richer generic classes and overloads round-trip into the generated help. These annotations are only supported by EmmyLua, so LuaLS still uses a broader fallback in _meta.lua. AI-assisted: Codex
* feat(lua)!: vim.isnil, vim.nonnil, deprecate vim.F #39495Olivia Kinnear2026-05-06
|
* perf(lua): memoize `key_fn` results #39568Yi Ming2026-05-05
| | | | | | | | | | | Problem: When using `vim.list.unique` or `vim.list.bisect`, if the `key` function is complex, it can degrade performance, because it is invoked on every comparison Solution: The `key` interface convention is designed specifically to address this issue; performance can be improved by memoizing its results. Also added the shorthand use of the field name string as the key.
* feat(vim.net): request() accepts more http methods #39406Ellison2026-05-01
|
* build(lint): allow "bufnr" as positional param #39515Justin M. Keyes2026-04-30
| | | | | Allow `bufnr` as a positional param name because it is very common. However as a field name, or part of a function name, it is usually a mistake.
* feat(img): vim.ui.img.del(math.huge) clears all images #39484Chip Senkbeil2026-04-29
| | | | | | | | | | | | Problem: Similar to clearmatches(), it's always necessary to provide a fallback that allows the user to do a "global reset" when something goes wrong. Solution: vim.img.del(math.huge) clears all images. Use kitty's d=A command to clear all placements in a single escape sequence rather than N individual deletes, also freeing stored image data not referenced by the scrollback buffer.
* feat(ui): use vim.ui.select for :tselect, z= #39478Justin M. Keyes2026-04-28
| | | | | | | | | | | | | | | | | | | | | Problem: `:tselect` and `z=` (spell suggest) have their own bespoke select menus. Solution: - Delegate to `vim.ui.select` instead. - Bonus: - `:tselect` gains mouse support. `print_tag_list` didn't suport mouseclick. This causes some minor regressions, which are not blockers: - `z=` no longer draws the list right-left if 'rightleft' is set. - TODO: can/should `vim.ui.select` / `vim.fn.inputlist()` handle that? - `:tselect` - No "column" headings (`# pri kind tag file`). - No highlighting: (HLF_T: tag name, HLF_D: file, HLF_CM: extra fields). - TODO: can `vim.ui.select()` support highlighted chunks (`[[text, hl_id], ...]`) ? fix https://github.com/neovim/neovim/issues/25814 fix https://github.com/neovim/neovim/issues/31987
* docs(lua): place vim.ui.img section after vim.ui #39456Olivia Kinnear2026-04-27
|
* refactor(lua): move vim.wait into runtime LuaLewis Russell2026-04-27
| | | | | | | | | | | | | | Move vim.wait into runtime/lua/vim/_core/editor.lua and replace the C entrypoint with narrow vim._core helpers for polling, UI flushing, and interrupt checks. Keep the existing interval semantics by retaining the dummy timer that wakes the loop while it is otherwise idle. Update the docs to describe the success return values correctly, and adjust the test expectation for the new vim.validate() callback error. AI-assisted: Codex
* docs: fix CI failure #39436zeertzjq2026-04-26
|
* feat(ui): vim.ui.img api #37914Chip Senkbeil2026-04-26
| | | | | | | Problem: No builtin api to load and display images. Solution: Introduce vim.ui.img. Only supports kitty graphics protocol, currently.
* docs: sort quasi-keysetsJustin M. Keyes2026-04-26
|
* docs: vim.ui.select, miscJustin M. Keyes2026-04-26
|
* feat(vim.pos): accept buf=0 for current buf #39414Luis Calle2026-04-26
|
* docs(vim.ui): "preview" interface for vim.ui.select() #37360Evgeni Chasnovski2026-04-25
| | | | | | | | | | | | | | | Problem: Plugins may want to have a way to show more details about items when using `vim.ui.select`. This is a fairly common problem that prompts plugin authors to implement dedicated sources/pickers for fuzzy picker plugins that are popular at the moment. Solution: Document a way for `vim.ui.select` to provide preview: - `vim.ui.select` users can provide `opts.preview_item` function that creates/uses a buffer and its contents at certain position to show more details about an item. - `vim.ui.select` implementations may use `opts.preview_item` in the way they see fit (like show the buffer in a separate/same window interactively/on-demand or do nothing) if they have a way to show more information about an item.
* docs: misc #39256Justin M. Keyes2026-04-25
|
* docs: misc #39045Justin M. Keyes2026-04-18
|
* test: lint EXX error codes #8155Justin M. Keyes2026-04-16
| | | | | | | | | | | Problem: - Choosing a new EXX error code is tedious. - It's possible to accidentally use an EXX error code for different purposes. Solution: Add a lint check which requires EXX error codes to have a :help tag. This also avoids duplicates because `make doc` does `:helptags ++t doc` which fails if duplicates are found.
* 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.
* Merge #39078 render class dot members as module functionsJustin M. Keyes2026-04-16
|\
| * feat(docs): render class dot members as module functionsYi Ming2026-04-16
| | | | | | | | AI-assisted: Codex
| * revert: "docs: vim.range, vim.pos #38869"Yi Ming2026-04-15
| | | | | | | | This reverts commit c530fd8e752607f57b83854b74b029eabe8d57c6.
* | fix(lua): make vim.deep_equal cycle-safeLewis Russell2026-04-15
|/ | | | AI-assisted: Codex
* docs: vim.posJustin M. Keyes2026-04-12
|
* docs: miscJustin M. Keyes2026-04-12
| | | | | | | | Close #38748 Close #38866 Co-authored-by: Mario Loriedo <mario.loriedo@gmail.com> Co-authored-by: Anakin Childerhose <anakin@childerhose.ca>
* feat(vim.net): custom request() headers #38837Ellison2026-04-10
| | | | | | | Problem Cannot specify headers in vim.net.request() call. Solution Support opts.headers in vim.net.request opts.
* docs: vim.range, vim.pos #38869Luis Calle2026-04-08
| | | | | | | Problem: `vim.Range` and `vim.Pos` have signature mismatches on the docs of some functions. Solution: Split the "module" functions from the "class" functions (just like it's done in other modules like `vim.version`) and regenerate the docs.
* feat(filetype): `vim.filetype.inspect()` returns copy of registry #38831Christian Clason2026-04-06
| | | | | | | | Problem: No way of inspecting the (user-added) filetype detection rules. Solution: Add `vim.filetype.inspect()` returning copies of the internal `extension`, `filename`, `pattern` tables. Due to the dynamic nature of filetype detection, this will in general not allow getting the list of known filetypes, but at least one can see if a given extension is known.
* feat(vim.pos)!: require `buf` param on vim.pos, vim.range #38665Luis Calle2026-04-06
| | | | | | | Problem: `buf` is optional even though its needed to perform conversions and the ordering of `(buf, row, col)` is not consistent. Solution: make `buf` mandatory on `vim.range` and `vim.pos` and enforce the `buf, row, col` ordering
* docs: misc #38584Justin M. Keyes2026-04-01
|