aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
* fix(health): "Create bug report" buttonJustin M. Keyes2026-05-20
|
* fix(health): show Nvim-owned checks at the topJustin M. Keyes2026-05-20
|
* feat(health): highlight current bufferJustin M. Keyes2026-05-20
| | | | | | | | | Problem: A benefit of the old `:LspInfo` was that it showed info related to the "current buffer" a bit more clearly. Solution: Highlight the "current buffer" in the LSP checkhealth report.
* fix(health): cleanup LSP healthcheckJustin M. Keyes2026-05-20
| | | | | | | | | Problem: filewatcher and position-encoding info is reported after the big list of client details. Solution: - report the info in the top-level, not in dedicated subsections.
* feat(fswatch): report filewatchers in :checkhealthJustin M. Keyes2026-05-20
|
* fix(pack): collect "Removed plugin" into one message #39840Olivia Kinnear2026-05-20
|
* Merge #39889 from ofseed/pos-utilJustin M. Keyes2026-05-20
|\ | | | | refactor(pos,range): drop `to_cursor`, extract `vim.pos._util`
| * 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.
| * refactor(pos,range): extract `vim.pos._util`Yi Ming2026-05-20
| | | | | | | | | | | | | | | | | | | | | | Problem: - To share logic, creating a `vim.Range` currently creates two `vim.Pos` values as intermediates, which causes unnecessary table allocations. - `pos.lua` and `range.lua` contain some overlapping logic. Solution: Add `vim.pos._util`, a module for handling positions represented directly by `row` and `col`.
| * 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()`,
* | 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.
* | fix(lua): fields of `nvim.spellfile.Opts` are optional #39902Olivia Kinnear2026-05-20
|/
* vim-patch:9.2.0500: filetype: some html files wrongly recognized as ↵zeertzjq2026-05-19
| | | | | | | | | | | | | | | | | | | htmlangular (#39880) Problem: filetype: some html files are wrongly recognized as htmlangular Solution: Use the \< atom to anchor ng-template and ng-content to start of word (truffle) Prevent false-positive htmlangular detection on words containing 'ng-template' or 'ng-content' as a substring (e.g. 'song-template', 'sing-content'). Anchor both branches with \< to require a word start, matching the \<DTD\s\+XHTML\s idiom used five lines below. related: neovim/neovim#39778. closes: vim/vim#20246 https://github.com/vim/vim/commit/354ab1a69efbe5f84cd7225bc3945db3f2cec5c4 Co-authored-by: truffle <truffleagent@gmail.com>
* Merge #39822 from ofseed/pos-markJustin M. Keyes2026-05-18
|\ | | | | feat(pos,range): pos:to_mark(), pos.mark(), range:to_mark(), range.mark()
| * feat(lsp)!: deprecate `vim.lsp.util.character_offset()`Yi Ming2026-05-18
| |
| * fix(range): handle inclusive/exclusive positions on multibyte charactersYi Ming2026-05-18
| |
| * 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().
* | Merge #39832 from justinmk/doc2Justin M. Keyes2026-05-18
|\ \ | | | | | | docs: misc, remove legacy/textobjects_spec.lua
| * | docs: misc, $NVIM_TERMDEFSJustin M. Keyes2026-05-18
| |/
* / fix(lsp): preserve trigger chars on completion #39850glepnir2026-05-18
|/ | | | | | | | Problem: After 767fbd8, typing trigger chars would open completion but the chars were removed. Solution: Use filterText fallback so selected item respects typed trigger chars.
* feat(tui): $NVIM_TERMDEFS can override builtin terminfo #39555Kyle2026-05-17
| | | | | | | | | | | | | Problem: - Windows users can't use terminfo to configure their terminal capabilities. #37274 - Terminfo definitions sometimes get out of date or are simply inaccurate. - Eventually, we may want to drop terminfo, relying primarily on built-in definitions. Users will still need some flexibility. Solution: Support $NVIM_TERMDEFS environment variable, which is JSON data that defines "terminfo" definitions that override our builtin terminfo.
* fix(startup): emitting useless OptionSet #39830Puneet Dixit2026-05-17
| | | | | | | | | | | Problem: During startup, we manually trigger a useless and misleading `OptionSet` event, which doesn't set `v:option_*` values (this is a limitation of `nvim_exec_autocmds`). https://github.com/neovim/neovim/blob/ad4bc2d90c5109c24bf6f0119ad31276f1518c6f/runtime/lua/vim/_core/defaults.lua#L939. Solution: The `nvim_exec_autocmds('OptionSet',…)` call does not serve any purpose since 5cbb9d613bf6d8983b5effd7e20343a4ef497c06, so just drop it.
* fix(lsp): fallback to filterText for non-matching PlainText items #39695glepnir2026-05-17
| | | | | | | | | | Problem: PlainText completion items used `textEdit.newText` or `insertText` as the completion word even when they did not match the typed prefix. This could break popup completion behavior like 'completeopt+=longest'. Solution: Fall back to `filterText` when `newText` or `insertText` does not match the typed prefix.
* Merge #39820 from echasnovski/pack-get-moreJustin M. Keyes2026-05-17
|\
| * feat(pack): update `get()` to be able to fetch data from plugin sourceEvgeni Chasnovski2026-05-17
| | | | | | | | | | | | | | | | | | | | Problem: There is currently no convenient way to programmatically check for new updates from plugin source. Running `vim.pack.update()` is one approach, but it opens a confirmation buffer that requires a manual action to close. Solution: Add `opts.offline` to `vim.pack.get()` that will first fetch new updates from plugin source before computing the output.
| * feat(pack): update `get()` to return revision of a pending updateEvgeni Chasnovski2026-05-17
| | | | | | | | | | | | | | | | | | | | | | | | Problem: No convenient way to programmatically get the revision that would be checked out after `vim.pack.update()` (with `offline=true`). Doing this manually requires resolving `spec.version` which is not trivial. This data can be useful for custom reporting of pending updates or third party confirmation step. Solution: Make `get()` include a new field for the revision that points at the state after applying pending update. This is also the same as the revision of resolved `spec.version`.
| * feat(pack): update `get()` to take `rev` from actual repo if `info=true`Evgeni Chasnovski2026-05-17
| | | | | | | | | | | | | | | | | | | | | | | | Problem: `vim.pack.get()` always uses lockfile as the source for the `rev` field. This is fast, but may be misleading in case of a corrupted lockfile. Solution: Compute revision from Git repo on disk if `info=true` (default), use lockfile otherwise. This does increase execution time (as a result of one extra `git ...` call for every plugin), but `info=true` is already designed to be informative and not necessarily fast.
* | 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.
* | 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
* | 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().
* feat(events): add TabMoved autocommand event #24137yashlala2026-05-16
| | | | | | | | | | Problem: No way to handle a "tab moved" event. Use-case: tabline plugins may cache tab labels, and need to know when to invalidate their cache. Solution: Add a `TabMoved` event that triggers whenever tabs are reordered via `:tabmove` or via mouse click-and-drag.
* refactor(lsp): remove some private utility functionsYi Ming2026-05-16
| | | | | | | | | Problem: `make_position_params`/`get_line_byte_from_position`/`make_line_range_params` are private functions and their functionality can be replaced by `vim.pos` now. Solution: Remove them, use `vim.pos` instead.
* refactor(pos): move `get_lines` from `lsp.util` to `pos`Yi Ming2026-05-16
|
* fix(pos): precisely handle positions at the end of the fileYi Ming2026-05-16
|
* feat(prompt): support 'scrollback' option in prompt-buffers #39793Tomas Slusny2026-05-16
| | | | | | | | | | | | | | Problem: There is a lot of overlap between terminal and prompt buffer, but no easy way to limit the number of lines kept above the prompt to prevent performance and other issues. This is desirable for both example use cases in current documentation, chat UI and repl/shell plugins. Solution: Use existing 'scrollback' option to limit prompt-buffer lines as well. Signed-off-by: Tomas Slusny <slusnucky@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* 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(pack): :packupdate, :packdel commands #39693Olivia Kinnear2026-05-16
| | | | | | Define `:packupdate` and `:packdel` as separate commands instead of a unified `:pack {subcommand}` because the semantics between the two commands vary differently enough that it doesn't make sense to combine them. Additionally, `:pack! update/del` looks bad.
* vim-patch:9.2.0489: filetype: some Objective-C files are not recognizedzeertzjq2026-05-16
| | | | | | | | | | | | Problem: filetype: some Objective-C files are not recognized Solution: Add g:filetype_mm override variable, improve the objective c pattern detection (Keith Smiley). closes: vim/vim#20221 https://github.com/vim/vim/commit/bc7f736a393123c1349fe3fbe4fb48bfc56754b1 Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
* 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.
* docs: dev, lsp, indent-guides #39756Justin M. Keyes2026-05-14
| | | | | | | - document "indent guides" https://github.com/neovim/neovim/issues/39726 - document guidance for "subcommands" https://github.com/neovim/neovim/issues/32263#issuecomment-4436002808 Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: Noa Levi <275430404+lphuc2250gma@users.noreply.github.com>
* 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).
* feat(highlights): new Dimmed hl group for de-emphasized text #39505Michele Campeotto2026-05-13
| | | | | | | | | | | | | Problem: Many color schemes assume the Comment hl group is dim text and use it for secondary text, decorations, or parts of UI. This is true for many color schemes but not all. Solution: Introducing a new highlight group with a more specific meaning, similar to Underlined or Ignore. The new group links to Comment by default so the behavior is unchanged for color schemes that don't define it.
* refactor(tutor): use inline comments instead of json file #39714Nathan Zeng2026-05-13
| | | | | | | | | | Problem: Expected text for interactive marks is in a separate json file from the tutor file. When the tutor file is updated, line numbers (potentially many) have to be updated in the json file. This is a burden for maintenance and automatic testing. Solution: Put the expected text inline in the tutor file, marked with `[[]]`. Parse and remove the comments before opening the tutor file so extmarks can be applied.
* vim-patch:9.2.0470: No way to hook into put commandszeertzjq2026-05-13
| | | | | | | | | | | | | | Problem: No way to hook into put commands (yochem) Solution: Introduce TextPutPre and TextPutPost autocommands (Foxe Chen). fixes: vim/vim#18701 closes: vim/vim#20144 https://github.com/vim/vim/commit/e0781bd5bfd1acc2c4d5d01ec60fecafc99ee3e2 Co-authored-by: Foxe Chen <chen.foxe@gmail.com>
* Merge pull request #38675 from bfredl/errdeferbfredl2026-05-12
|\ | | | | feat(ui_client): "press ENTER" free nvim crashes
| * 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
* | 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).