aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
* docs(lua): add vim.pack to _meta.lua #34957nikolightsaber2025-07-16
| | | | | | | Problem: Goto definition to pack.lua does not work Solution: Add pack to _meta.lua Co-authored-by: Nikolai Devolder <nikolai.devolder@yamabiko.eu>
* vim-patch:9.1.1549: filetype: pkl files are not recognizedChristian Clason2025-07-16
| | | | | | | | | | | | | | | | Problem: filetype: pkl files are not recognized Solution: detect *.pkl files as pkl filetype, include a filetype plugin (Riley Bruins) References: https://pkl-lang.org/ https://github.com/apple/pkl closes: vim/vim#17751 https://github.com/vim/vim/commit/d128889b306680338dbfb54ccc1ff32dc114165d Co-authored-by: Riley Bruins <ribru17@hotmail.com>
* vim-patch:9.1.1548: filetype: OpenFGA files are not recognizedChristian Clason2025-07-16
| | | | | | | | | | | | | | | | Problem: filetype: OpenFGA files are not recognized Solution: detect *.fga files as fga filetype, include an fga filetype plugin (Riley Bruins) References: https://github.com/openfga https://marketplace.visualstudio.com/items?itemName=openfga.openfga-vscode closes: vim/vim#17752 https://github.com/vim/vim/commit/0992f62fc18431296d3d5d6ab04317b8de4c76d9 Co-authored-by: Riley Bruins <ribru17@hotmail.com>
* fix(lsp): close floating preview window correctly #34946Donatas2025-07-15
| | | | | | | | | Problem: After 28b7c2d (found with bisect) the hover preview window does not close when :edit'ing another file, even when you move the cursor. Solution: Change the BufLeave to target the original buffer, not the preview buffer.
* feat(term): increase max scrollback to 1000000Lewis Russell2025-07-14
| | | | | | | | | | | Problem: Cannot use `nvim_open_term()` to pipe terminal scrollback > 100000 Solution: Increase scrollback limit to 1000000 If there's no technical consequences of doing this, can be set even higher in the future.
* feat(net): vim.net.request(), :edit [url] #34140Tom Ampuero2025-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Nvim depends on netrw to download/request URL contents. Solution: - Add `vim.net.request()` as a thin curl wrapper: - Basic GET with --silent, --show-error, --fail, --location, --retry - Optional `opts.outpath` to save to a file - Operates asynchronously. Pass an `on_response` handler to get the result. - Add integ tests (requires NVIM_TEST_INTEG to be set) to test success and 404 failure. - Health check for missing `curl`. - Handle `:edit https://…` using `vim.net.request()`. API Usage: 1. Asynchronous request: vim.net.request('https://httpbingo.org/get', { retry = 2 }, function(err, response) if err then print('Fetch failed:', err) else print('Got body of length:', #response.body) end end) 2. Download to file: vim.net.request('https://httpbingo.org/get', { outpath = 'out_async.txt' }, function(err) if err then print('Error:', err) end end) 3. Remote :edit integration (in runtime/plugin/net.lua) fetches into buffer: :edit https://httpbingo.org/get
* refactor(lsp): drop vim.lsp.util._refresh() #33903Yi Ming2025-07-12
| | | | | | | | | | | | | | | Problem: - util._refresh() is only used by `inlay_hint.lua` and `document_color.lua`, and both have their own wrapper functions; - util._refresh() provides unified parameters, but this layer of wrapping is almost meaningless because - document color does not need the range parameter; - inlay hint requires a range parameter, but it is not complicated Therefore, it can be considered redundant. ref https://github.com/neovim/neovim/pull/32887#discussion_r1996413602 Solution: Remove it.
* fix(lua): vim.diff is nil in uv.new_work() thread #34909Justin M. Keyes2025-07-12
| | | | | | | | | | | | | | | | Problem: The "gitsigns" plugin runs `vim.diff` in a thread (`uv.new_work`), but `vim.diff` is nil in that context: Lua callback: …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: bad argument #1 to 'decode' (string expected, got nil) stack traceback: [C]: in function 'decode' …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: in function <…/gitsigns.nvim/lua/gitsigns/diff_int.lua:29> Luv thread: …/gitsigns.nvim/lua/gitsigns/diff_int.lua:63: attempt to call field 'diff' (a nil value) Solution: Revert the `stdlib.c` change (set `vim.diff` instead of `vim._diff`).
* refactor(lsp): rename vim.lsp.semantic_tokens start/stop to enable()Yi Ming2025-07-13
|
* refactor(lsp): utility functions for `enable()/is_enabled()`Yi Ming2025-07-13
|
* fix(lsp): prevent flicker in codelens virtual text #34888Jaehwang Jung2025-07-12
| | | | | | | | | | | | | | | Problem: Calling lsp.codelens.refresh() causes transient visual flicker because codelens virtual texts are briefly replaced with "Unresolved lens ..." before being resolved and redrawn. Since refresh() is triggered frequently (e.g., on CursorHold or InsertLeave), this leads to redundant and noisy virtual text updates, even when the final text hasn't changed. Solution: Do not update virtual text for a line if some lenses for that line are not resolved yet. A trade-off is that the user may temporarily see outdated virtual text. However, that's preferable to spamming updates on every refresh.
* refactor(lua): rename vim.diff => vim.text.diff #34864Justin M. Keyes2025-07-12
| | | | | | | | Problem: `vim.diff()` was introduced before we had the `vim.text` module, where it obviously belongs. Solution: Move it.
* fix(health): bad format() call #34904Justin M. Keyes2025-07-12
| | | | | | | | | | Problem: Bad format() call on PUC Lua #34901 Error: Failed to run healthcheck for "vim.health" plugin. Exception: runtime/lua/vim/health/health.lua:89: bad argument #1 to 'format' (string expected, got nil) Solution: Avoid passing nil.
* docs(autocmd): generate events enum type #34883luukvbaal2025-07-12
|
* fix(extui): disable cmdline highlighter when showing a message (#34887)luukvbaal2025-07-12
| | | | | | Problem: When message is moved from message window to cmdline, the cmdline highlighter is not disabled. Solution: Disable the highlighter (and only scroll to bottom when message was moved to pager).
* vim-patch:9.1.1538: tests: string options in gen_opt_test.vim not fully ↵zeertzjq2025-07-11
| | | | | | | | | | | | sorted (#34891) Problem: tests: string options in gen_opt_test.vim aren't fully sorted. Solution: Sort the string options alphabetically. Also make description of 'maxsearchcount' start with lower-case for consistency with other options, update documentation for searchcount(). closes: vim/vim#17720 https://github.com/vim/vim/commit/7306e8fcdb6fd17276b6aafb23a522cefecb5857
* fix(extui): check if buffers/windows exist before deleting (#34886)Tomasz N2025-07-11
| | | | Problem: Disabling vim._extui may try to delete non-existent windows/buffers. Solution: Check that window/buffer is valid before deleting.
* Merge #34558 docsJustin M. Keyes2025-07-10
|\
| * docs: api, pack, events, developJustin M. Keyes2025-07-10
| |
* | vim-patch:9.1.1535: the maximum search count uses hard-coded value 99 (#34873)zeertzjq2025-07-11
|/ | | | | | | | | | | | | Problem: The maximum search count uses a hard-coded value of 99 (Andres Monge, Joschua Kesper) Solution: Make it configurable using the 'maxsearchcount' option. related: vim/vim#8855 fixes: vim/vim#17527 closes: vim/vim#17695 https://github.com/vim/vim/commit/b7b7fa04bf79f2f13ed6e789b76262753da31dde Co-authored-by: Christian Brabandt <cb@256bit.org>
* test(ui/{cmdline,message}2_spec): reduce flakiness/runtime #34875luukvbaal2025-07-10
| | | | | | | | Problem: Storing the configured 'cmdheight' value is scheduled and may happen after cmdline2_spec already entered block_mode. Excessive wait time for expected screen state due to delayed ruler after an error message. Solution: Only schedule storing the user configured 'cmdheight' if v:vim_did_enter is unset. Use regular message instead of error.
* feat(diagnostic): jump to related info location from `open_float` #34837Riley Bruins2025-07-10
| | | | | | This commit allows users to jump to the location specified in a diagnostic's `relatedInformation`, using `gf` from within the `open_float` window. The cursor need only be on line that displays the related info.
* refactor(lsp): simplify multiline semantic token logic #34698Riley Bruins2025-07-10
| | | | This commit makes it so that only one call to `vim.str_byteindex` is needed, at the end of the `end_line`, `end_col` calculations.
* feat(lsp): support `textDocument/colorPresentation` (#34823)Maria José Solano2025-07-10
| | | feat(lsp): support for `textDocument/colorPresentation`
* fix(lsp): custom 'winborder' in make_floating_popup_options() #34868Sebastian Lyng Johansen2025-07-10
|
* docs: move vim.system to own sectionLewis Russell2025-07-10
|
* vim-patch:32a1b26: runtime(filetype): improve asm heuristics and move into ↵zeertzjq2025-07-10
| | | | | | | | | | | | | | | | | | | | FTasmsyntax() (#34863) fixes: vim/vim#17474 closes: vim/vim#17683 https://github.com/vim/vim/commit/32a1b26ef3e821de9b5c518829b08002e933fa5a vim-patch:41ee98c: runtime(filetype): fix incorrect pattern and break early - Using `\n` is incorrect, as result of getline() does not contain line breaks and only uses `\n` for NUL bytes. - Return when b:asmsyntax is set, like many other filetypes. closes: vim/vim#17706 https://github.com/vim/vim/commit/41ee98c3c5342867cb99dfcddbe8d53caeda22db Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
* feat(option): custom chars in 'winborder' #33772glepnir2025-07-09
| | | | | Problem: winborder option only supported predefined styles and lacked support for custom border characters. Solution: implement parsing for comma-separated list format that allows specifying 8 individual border characters (topleft, top, topright, right, botright, bottom, botleft, left).
* feat(extui): use winborder for msg window #34859Sebastian Lyng Johansen2025-07-09
| | | | | | | | | | | Problem: The message window is essentially a regular floating window but does not use 'winborder'. Still some "scratch" buffer options unset after it was removed from its window. Solution: Do not set the border when opening the window message. Forego passing `scratch = true` when opening a buffer, set the options manually when necessary. Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
* feat(extui): show dismissed message in cmdline (#34745)luukvbaal2025-07-09
| | | | | | | | | | Problem: An accidental key press can dismiss a routed message to be shown in full before the user was able to read it. 'verbose' message routing based on an outdated condition results in "last_set" messages being separated from its message pair. Solution: Show a message to be shown in full in the cmdline window instead of the pager. Keep it there and update the spill indicator when the message is dismissed. Remove the 'verbose' message routing.
* vim-patch:9.1.1526: completion: search completion match may differ in casezeertzjq2025-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: completion: search completion match may differ in case (techntools) Solution: add "exacttext" to 'wildoptions' value (Girish Palya) This flag does the following: exacttext When this flag is present, search pattern completion (e.g., in |/|, |?|, |:s|, |:g|, |:v|, and |:vim|) shows exact buffer text as menu items, without preserving regex artifacts like position anchors (e.g., |/\<|). This provides more intuitive menu items that match the actual buffer text. However, searches may be less accurate since the pattern is not preserved exactly. By default, Vim preserves the typed pattern (with anchors) and appends the matched word. This preserves search correctness, especially when using regular expressions or with 'smartcase' enabled. However, the case of the appended matched word may not exactly match the case of the word in the buffer. fixes: vim/vim#17654 closes: vim/vim#17667 https://github.com/vim/vim/commit/93c2d5bf7f01db594a3f5ebecbd5a31dfd411544 Co-authored-by: Girish Palya <girishji@gmail.com>
* docs: tag of `:EditQuery` #34844Phạm Bình An2025-07-08
| | | | | | | | | | Problem: - Running `:h :EditQuery` throws error `E149: Sorry, no help for :EditQuery` - vim_diff.txt miss an entry for `:EditQuery` Solution: - Make tag `[:EditQuery]()` right-aligned, similar to command `:Open` - Update vim_diff.txt
* fix(health): floating window closes when opening TOC (gO) #34794glepnir2025-07-08
| | | | | Problem: Health check floating window gets closed when pressing 'gO' to show TOC because LSP floating preview system auto-closes on BufEnter events triggered by :lopen. Solution: Temporarily disable BufEnter event for the current window during TOC operations and adjust window layout to prevent overlap.
* docs: type fixes #34831phanium2025-07-07
|
* feat(lsp): support diagnostic related information (#34474)Riley Bruins2025-07-07
|
* vim-patch:9.1.1517: filetype: autopkgtest files are not recognizedChristian Clason2025-07-07
| | | | | | | | | | | | | | | | | | Problem: filetype: autopkgtest files are not recognized Solution: detect */debian/tests/control files as autopkgtest filetype (James McCoy) Autopkgtest is a Debian tool for testing installed versions of packages when other, related packages are updated. Reference: - https://www.debian.org/doc/debian-policy/autopkgtest.txt related: vim/vim#17679 https://github.com/vim/vim/commit/5bcc492649f2d810577dd8dc4e1fb92f548847eb Co-authored-by: James McCoy <jamessan@jamessan.com>
* refactor(lsp): stateful data abstraction, vim.lsp.Capability #34639Yi Ming2025-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Closes #31453 Solution: Introduce `vim.lsp.Capability`, which may serve as the base class for all LSP features that require caching data. it - was created if there is at least one client that supports the specific method; - was destroyed if all clients that support the method were detached. - Apply the refactor for `folding_range.lua` and `semantic_tokens.lua`. - Show active features in :checkhealth. Future: I found that these features that are expected to be refactored by `vim.lsp.Capability` have one characteristic in common: they all send LSP requests once the document is modified. The following code is different, but they are all for this purpose. - semantic tokens: https://github.com/neovim/neovim/blob/fb8dba413f2bcaa61c15d1854b28112e3e91a035/runtime/lua/vim/lsp/semantic_tokens.lua#L192-L198 - inlay hints, folding ranges, document color https://github.com/neovim/neovim/blob/fb8dba413f2bcaa61c15d1854b28112e3e91a035/runtime/lua/vim/lsp/inlay_hint.lua#L250-L266 I think I can sum up this characteristic as the need to keep certain data synchronized with the latest version computed by the server. I believe we can handle this at the `vim.lsp.Capability` level, and I think it will be very useful. Therefore, my next step is to implement LSP request sending and data synchronization on `vim.lsp.Capability`, rather than limiting it to the current create/destroy data approach.
* fix(lsp): convert the encoded position to line byte (#34824)Yi Ming2025-07-06
|
* feat(options): per-buffer 'busy' status #34493Shadman2025-07-06
| | | | | | | | Problem: Plugins cannot mark a buffer as "busy". Solution: - Add a buffer-local 'busy' option. - Show a busy indicator in the default 'statusline'.
* vim-patch:9.1.1518: getcompletiontype() may crash (#34819)zeertzjq2025-07-06
| | | | | | | | | | Problem: getcompletiontype() crashes when no completion is available (after v9.1.1509). Solution: Don't call set_expand_context() (zeertzjq) fixes: vim/vim#17681 closes: vim/vim#17684 https://github.com/vim/vim/commit/e2c0f81dd014b03a40af6b2c42463b7a0d92f5d6
* refactor(lsp): narrower `hierarchy` argument type (#34799)Maria José Solano2025-07-06
|
* fix(treesitter): inconsistent highlight of multiline combined injection #32619Artem2025-07-06
| | | | | | | Problem: Combined injections not entirely highlighted. Solution: Reapply layer highlights on each line.
* fix(vim.pack): add() stops unexpectedly on package load error #34787Phạm Bình An2025-07-06
| | | | | | | | | | | Problem: Error when adding a plugin will make all following plugins not `:packadd`ed Solution: - add() should handle errors from :packadd with pcall() Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* feat(lsp): handle deprecated document symbols (#34751)Maria José Solano2025-07-06
|
* refactor(lsp): consistent usage of vim.notify #34802Maria José Solano2025-07-06
|
* vim-patch:9.1.1509: patch 9.1.1505 was not goodzeertzjq2025-07-06
| | | | | | | | | | | | | | | | | Problem: Patch 9.1.1505 was not good Solution: Revert "patch 9.1.1505: not possible to return completion type for :ex command" and instead add the getcompletiontype() function (Hirohito Higashi). related: vim/vim#17606 closes: vim/vim#17662 https://github.com/vim/vim/commit/96b3ef23896ce70b2fdf3425ba2c013ce2840db6 Cherry-pick Test_multibyte_expression() from Vim, as it passes. Co-authored-by: Hirohito Higashi <h.east.727@gmail.com> Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
* vim-patch:9.1.1505: not possible to return completion type for :ex commandzeertzjq2025-07-06
| | | | | | | | | | | | | Problem: not possible to return command-line completion type for :ex command Solution: make getcmdcompltype() accept an optional and return the command-line completion for that arg (Shougo Matsushita). closes: vim/vim#17606 https://github.com/vim/vim/commit/5d2354fc07b642f8835bef27e6dd46ee705726b5 Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
* vim-patch:9.1.1512: completion: can only complete from keyword characters ↵zeertzjq2025-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#34798) Problem: completion: can only complete from keyword characters Solution: remove this restriction, allow completion functions when called from i_CTRL-N/i_CTRL-P to be triggered from non-keyword characters (Girish Palya) Previously, functions specified in the `'complete'` option were restricted to starting completion only from keyword characters (as introduced in PR 17065). This change removes that restriction. With this change, user-defined functions (e.g., `omnifunc`, `userfunc`) used in `'complete'` can now initiate completion even when triggered from non-keyword characters. This makes it easier to reuse existing functions alongside other sources without having to consider whether the cursor is on a keyword or non-keyword character, or worry about where the replacement should begin (i.e., the `findstart=1` return value). The logic for both the “collection” and “filtering” phases now fully respects each source’s specified start column. This also extends to fuzzy matching, making completions more predictable. Internally, this builds on previously merged infrastructure that tracks per-source metadata. This PR focuses on applying that metadata to compute the leader string and insertion text appropriately for each match. Also, a memory corruption has been fixed in prepare_cpt_compl_funcs(). closes: vim/vim#17651 https://github.com/vim/vim/commit/ba11e78f1d5342786faed0ebd5b09ffee7f7ff86 Co-authored-by: Girish Palya <girishji@gmail.com>
* vim-patch:9.1.1490: 'wildchar' does not work in search contextszeertzjq2025-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: 'wildchar' does not work in search contexts Solution: implement search completion when 'wildchar' is typed (Girish Palya). This change enhances Vim's command-line completion by extending 'wildmode' behavior to search pattern contexts, including: - '/' and '?' search commands - ':s', ':g', ':v', and ':vim' commands Completions preserve the exact regex pattern typed by the user, appending the completed word directly to the original input. This ensures that all regex elements — such as '<', '^', grouping brackets '()', wildcards '\*', '.', and other special characters — remain intact and in their original positions. --- **Use Case** While searching (using `/` or `?`) for lines containing a pattern like `"foobar"`, you can now type a partial pattern (e.g., `/f`) followed by a trigger key (`wildchar`) to open a **popup completion menu** showing all matching words. This offers two key benefits: 1. **Precision**: Select the exact word you're looking for without typing it fully. 2. **Memory aid**: When you can’t recall a full function or variable name, typing a few letters helps you visually identify and complete the correct symbol. --- **What’s New** Completion is now supported in the following contexts: - `/` and `?` search commands - `:s`, `:g`, `:v`, and `:vimgrep` ex-commands --- **Design Notes** - While `'wildchar'` (usually `<Tab>`) triggers completion, you'll have to use `<CTRL-V><Tab>` or "\t" to search for a literal tab. - **Responsiveness**: Search remains responsive because it checks for user input frequently. --- **Try It Out** Basic setup using the default `<Tab>` as the completion trigger: ```vim set wim=noselect,full wop=pum wmnu ``` Now type: ``` /foo<Tab> ``` This opens a completion popup for matches containing "foo". For matches beginning with "foo" type `/\<foo<Tab>`. --- **Optional: Autocompletion** For automatic popup menu completion as you type in search or `:` commands, include this in your `.vimrc`: ```vim vim9script set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu autocmd CmdlineChanged [:/?] CmdComplete() def CmdComplete() var [cmdline, curpos, cmdmode] = [getcmdline(), getcmdpos(), expand('<afile>') == ':'] var trigger_char = '\%(\w\|[*/:.-]\)$' var not_trigger_char = '^\%(\d\|,\|+\|-\)\+$' # Exclude numeric range if getchar(1, {number: true}) == 0 # Typehead is empty, no more pasted input && !wildmenumode() && curpos == cmdline->len() + 1 && (!cmdmode || (cmdline =~ trigger_char && cmdline !~ not_trigger_char)) SkipCmdlineChanged() feedkeys("\<C-@>", "t") timer_start(0, (_) => getcmdline()->substitute('\%x00', '', 'ge')->setcmdline()) # Remove <C-@> endif enddef def SkipCmdlineChanged(key = ''): string set ei+=CmdlineChanged timer_start(0, (_) => execute('set ei-=CmdlineChanged')) return key == '' ? '' : ((wildmenumode() ? "\<C-E>" : '') .. key) enddef **Optional: Preserve history recall behavior** cnoremap <expr> <Up> SkipCmdlineChanged("\<Up>") cnoremap <expr> <Down> SkipCmdlineChanged("\<Down>") **Optional: Customize popup height** autocmd CmdlineEnter : set bo+=error | exec $'set ph={max([10, winheight(0) - 4])}' autocmd CmdlineEnter [/?] set bo+=error | set ph=8 autocmd CmdlineLeave [:/?] set bo-=error ph& ``` closes: vim/vim#17570 https://github.com/vim/vim/commit/6b49fba8c8b97b178ddf81a9ca0c6f36c66f942f Co-authored-by: Girish Palya <girishji@gmail.com>
* vim-patch:9.1.1477: no easy way to deduplicate textzeertzjq2025-07-05
| | | | | | | | | | | | Problem: no easy way to deduplicate text Solution: add the :uniq ex command (Hirohito Higashi) closes: vim/vim#17538 https://github.com/vim/vim/commit/74f0a77bb9a170a25b03cacf640aa4e1b1d222b2 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>