Commit Graph

36366 Commits

Author SHA1 Message Date
Lewis Russell
aeba27f37b feat(doc): document Lua alternative for vim.fn
AI-assisted: Codex
2026-04-27 09:06:11 +01:00
Jan Edmund Lazo
689c824ef7 vim-patch:8.2.2128: there is no way to do something on CTRL-Z (#39440)
Problem:    There is no way to do something on CTRL-Z.
Solution:   Add VimSuspend and VimResume autocommand events. (closes vim/vim#7450)

100118c73a

----

Nvim implemented these events first and has enough tests.
test_suspend.vim relies on Vim 'terminal' feature.
Treat it as N/A even if all tests could be ported as Lua functional
screen/terminal tests.

----

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-04-27 03:57:01 +00:00
zeertzjq
f69aadd2b4 Merge pull request #39435 from zeertzjq/vim-0ca1121
vim-patch: runtime file updates
2026-04-27 07:02:53 +08:00
zeertzjq
9505dfb9ed vim-patch:076366b: runtime(javascript): Fix regex highlighting after (
- Fix regex highlighting after opening parens, javascriptParens was
  matching later.  Fixes issue vim/vim#20069.
- Add missing regex flags.
- Mark the file as unmaintained.  Thanks Claudio for all your work.

closes: vim/vim#20076

076366bd4e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-04-27 06:21:25 +08:00
zeertzjq
5834743735 vim-patch:c23bfd7: runtime(help): fix wrong check for existing HelpComplete function
To check for an existing HelpComplete function, exists('*HelpComplete')
should be used, as exists('HelpComplete') still returns 0 after sourcing
the ftplugin.

closes: vim/vim#20073

c23bfd7922
2026-04-27 06:21:25 +08:00
zeertzjq
f0ad84366a vim-patch:3cc7d50: runtime(algol68): Add new syntax file, ftplugin and filetype detection
- Add a syntax file update to Neville Dempsey's long-serving version
- Add a new rudimentary ftplugin
- Add filetype detection

Changes to the syntax file include:
- improved prelude, number and symbol highlighting
- prelude highlighting tests
- updated boiler plate

Note that these runtime files currently target Algol 68 Genie employing
the default UPPER stropping regime.  Support for GNU Algol 68 should
also be usable with the UPPER stropping regime, although somewhat less
complete.  Full support for the SUPPER stropping regime in GNU Algol 68
is also planned.

closes: vim/vim#19818

3cc7d50716

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-04-27 06:21:25 +08:00
zeertzjq
736b28630e vim-patch:1ce03d6: runtime(dockerfile): Update syntax, fix RUN command highlighting
Allow for docker comments to be interspersed in a multiline (continued)
RUN command argument.

fixes:  vim/vim#8364
closes: vim/vim#19829

1ce03d674a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-04-27 06:21:25 +08:00
zeertzjq
9c3b2da4f6 vim-patch:bf6892a: runtime(doc): Update documentation on :z
bf6892aaab

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-27 06:21:25 +08:00
zeertzjq
91a15b7137 vim-patch:0ca1121: runtime(help): make help omnifunc global
closes: vim/vim#20024

0ca1121d1f

Co-authored-by: Peter Cardenas <16930781+PeterCardenas@users.noreply.github.com>
2026-04-27 06:21:25 +08:00
zeertzjq
b26b543f16 docs: fix CI failure #39436 2026-04-26 18:20:46 -04:00
Chip Senkbeil
5f9e828008 feat(ui): vim.ui.img api #37914
Problem:
No builtin api to load and display images.

Solution:
Introduce vim.ui.img. Only supports kitty graphics protocol, currently.
2026-04-26 18:07:05 -04:00
Daigo Yamashita
8308544fe5 fix(lsp): handle relative='editor' in make_floating_popup_options() #39320
Problem:  With `vim.g.health = { style = 'float' }`, running
          `:checkhealth` from a `:help` buffer placed the float in the
          top-left corner instead of centered.
          make_floating_popup_options() picks the NW/NE/SW/SE anchor
          and the available height from cursor-relative metrics
          (winline(), wincol(), winheight()). When the caller passes
          relative='editor', those metrics are meaningless, so the
          function could flip to an 'E' anchor and clamp the float
          off-screen.
Solution: When relative='editor', treat the whole editor area as
          available space (lines_above=0, lines_below=&lines,
          wincol=0). This makes the NW anchor the natural choice and
          keeps the float position stable regardless of where the
          cursor is in the current window.

AI-assisted: Claude Code
2026-04-26 15:41:13 -04:00
Justin M. Keyes
834047cb14 Merge #39427 from justinmk/doc2 2026-04-26 14:39:29 -04:00
Justin M. Keyes
2d9e1ebb50 docs: sort quasi-keysets 2026-04-26 20:25:49 +02:00
Justin M. Keyes
033efbbd32 build(docs): sort/lint class fields and keysets
Problem:
Fields (key names) in classes, keysets, and quasi-keysets are ordered
randomly, which adds friction when reading docs.

Solution:
- Sort class fields and keysets when generating docs.
- Add a lint check for quasi-keysets (keysets defined as unstructured
  markdown lists within a docstring).
2026-04-26 20:25:48 +02:00
Justin M. Keyes
1e3e06f582 Merge #39398 from justinmk/doc2 2026-04-26 09:56:29 -04:00
Justin M. Keyes
6d0cdcd605 fix(eval): writestring() handling of null #39328
Problem:
- write_blob, write_string dereference args which may be NULL.
- `writefile(v:_null_blob, …)` fails.

Solution:
- Fix the annotation.
- Handle null blob.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2026-04-26 09:55:52 -04:00
Justin M. Keyes
d960ae6760 docs: vim.ui.select, misc 2026-04-26 14:18:00 +02:00
Justin M. Keyes
825bfba789 docs: lsp.CodeActionContext, nested @inlinedoc
- fix https://github.com/neovim/neovim/issues/39208
- fix generation of neste `@inlinedoc` classes
2026-04-26 13:29:43 +02:00
Luis Calle
682067c46a fix(vim.range): validate arguments on all cases #39415 2026-04-26 06:35:21 -04:00
Luis Calle
0b7a291238 feat(vim.pos): accept buf=0 for current buf #39414 2026-04-26 06:34:18 -04:00
zeertzjq
0039a13fe4 vim-patch:9.2.0395: tests: Test_backupskip() may read from $HOME (#39417)
Problem:  tests: Test_backupskip() may read from $HOME
Solution: Set $HOME to an empty value, use --clean
          (D Ben Knoble)

Even though we unset HOME, we can see via scriptnames that user files
are still sourced! One of my installed plugins warns when not compiled
with +python3, so this test has a "press Enter" prompt.

Use `--clean` like most other GetVimProg()'s do to fix it. Some tests
use `system()` instead, but that turns this test into a failure rather
than passing; I'm not sure why other tests don't suffer from this.

To prove to ourselves, we can use code like this:

    diff --git i/src/testdir/test_options.vim w/src/testdir/test_options.vim
    index a408e20e1..044364a54 100644
    --- i/src/testdir/test_options.vim
    +++ w/src/testdir/test_options.vim
    @@ -1179,6 +1179,7 @@ func Test_backupskip()
       " P_NODUP).  Run this in a separate instance and write v:errors in a file,
       " so that we see what happens on startup.
       let after =<< trim [CODE]
    +      call writefile([execute('scriptnames')], 'foo')
           let bsklist = split(&backupskip, ',')
           call assert_equal(uniq(copy(bsklist)), bsklist)
           call writefile(['errors:'] + v:errors, 'Xtestout')
    @@ -1196,7 +1197,7 @@ func Test_backupskip()
       " unset $HOME, so that it won't try to read init files
       let saveenv['HOME'] = getenv("HOME")
       call setenv('HOME', v:null)
    -  exe 'silent !' . cmd
    +  exe 'silent !' . cmd .. ' --cmd "echo &rtp"'
       call assert_equal(['errors:'], readfile('Xtestout'))

       " restore environment variables

Here, that causes "foo" to include a bunch of files under ~/.vim. I'm
not sure why this happens, but lets paper over it for the test.

We can also tell that (orthogonal to --clean) setting HOME='' works too.
Let's do that in addition since unsetting HOME isn't quite enough.

closes: vim/vim#20051

8d9c383aaf

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2026-04-26 16:59:32 +08:00
zeertzjq
924dbf10b8 vim-patch:5f7c524: runtime(doc): Update the ga output to match the actual output (#39412)
5f7c52408f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-25 23:17:17 +00:00
zeertzjq
cdd5009824 vim-patch:8.2.1498: on slow systems tests can be flaky (#39413)
Problem:    On slow systems tests can be flaky.
Solution:   Use TermWait() instead of term-wait(). (Yegappan Lakshmanan,
            closes vim/vim#6756)

733d259a83

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-04-25 23:03:40 +00:00
Jan Edmund Lazo
f8f95ee412 build(vim-patch): update N/A test files (#39405)
* build(vim-patch): test_clientserver.vim is N/A

Requires 'job' and 'clientserver' features.
Both N/A for Neovim.

* build(vim-patch): test_gui_init.vim is N/A

Starts with command 'CheckCanRuiGui' .
Nvim doesn't support ':gui' (yet).

* build(vim-patch): test_plugin_vimball.vim is N/A

Run ':h vimball'.

* build(vim-patch): test_remote.vim is N/A

Needs 'clientserver', 'terminal' features.

* build(vim-patch): test_short_sleep.py is for test_terminal.vim. Both N/A

* build(vim-patch): mark N/A files from test_crypt.vim

* build(vim-patch): mark N/A file for test_terminal3.vim

* build(vim-patch): mark N/A files channel/terminal/vim9 tests
2026-04-26 06:31:19 +08:00
Justin M. Keyes
e474c9856d Merge #39350 from echasnovski/pack-confirm-gx 2026-04-25 14:01:57 -04:00
Barrett Ruth
3d96095a0f ci(reviewers): cancel redundant reviewer assignment runs per PR #39404
Problem: The reviewer assignment workflow can run multiple times for
the same PR.

Solution: Ensure only the newest review-assignment run continues with
workflow concurrency.
2026-04-25 13:49:39 -04:00
Barrett Ruth
1aeaa61bcf ci(news): only rerun on ci:skip-news label changes #39399
Problem: The news workflow reruns on unrelated label events.

Solution: Only reevaluate the job when the changed label is
`ci:skip-news`.
2026-04-25 13:47:33 -04:00
Evgeni Chasnovski
e45cdbc7c4 fix(util): add and use forge link computation
Problem: There are many Git forges each with a different way of
  constructing permanent links to like commits and tags.

Solution: Add a private utility function that computes these special
  links on the best effort basis.
2026-04-25 20:29:19 +03:00
Evgeni Chasnovski
d01dc690e1 feat(pack): support textDocument/documentLink in confirmation buffer
Problem: In `vim.pack.update()` confirmation buffer it might be useful
  to be able to use `gx` (open link at cursor) when cursor is on
  something like commit or tag.

Solution: Add `textDocument/documentLink` method support for the
  in-process LSP. This may be used by LSP clients and makes `gx`
  automatically work.

  The shortcoming is that this requires tracking how to construct a URL
  from source and commit/tag. Currently only GitHub hosted repositories
  are supported.
2026-04-25 20:28:43 +03:00
Evgeni Chasnovski
c44df255aa docs(vim.ui): "preview" interface for vim.ui.select() #37360
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.
2026-04-25 13:03:55 -04:00
Yi Ming
775c7d1b53 fix(lsp): check window is still valid after async request #39396
Problem:
Since `foldclose` is async, it must wait for the request to return before actually executing, at which point the original window may no longer be valid.

Solution:
Check whether the window is valid before actually performing `foldclose`.
2026-04-25 12:11:09 -04:00
Peter Cardenas
eeee4bd4fc feat(treesitter/extmark): support removing a conceal highlight #35087
Problem:
Cannot remove a `@conceal` highlight when defined in highlights.scm.

Solution:
Support a `@noconceal` highlight that works similarly to `@nospell` where it
overrides the conceal set on the range to remove it. Additionally, can
set the conceal metadata field to false for the same behavior.
2026-04-25 11:42:44 -04:00
Justin M. Keyes
b70224e3bd docs: misc #39256 2026-04-25 11:16:18 -04:00
Justin M. Keyes
cb6c4cadf5 Merge #39389 from ofseed/lsp-parse-perf 2026-04-25 11:08:04 -04:00
Justin M. Keyes
0a9016689e ci: ensure full sanitizer logs are shown in CI #39361
Problem:
When ASAN detects an error in a child process, the process may be killed
by test teardown before ASAN finishes writing its log file. This results
in truncated logs with no stack trace.

Also, the sanitizer log content was only written to stdout (which the
test runner may not display) and not included in the test_assert error
message.

Solution:
- Poll (up to 2s) for the ASAN "SUMMARY" line before reading, so the
  crashing process has time to finish writing.
- Include full log content in the test_assert error message, so it
  appears in CI output regardless of stdout handling.
- Warn when the log appears truncated (no SUMMARY line found).
2026-04-25 10:33:39 -04:00
zeertzjq
4ed2e66d2e fix(channel): stack-buffer-overflow with exit during connection (#39387)
Problem:  When Nvim exits while connecting to a socket it leads to
          stack-buffer-overflow.
Solution: Associate the handle with the Stream and use the Stream's
          internal_close_cb to update the "closed" status.
2026-04-25 20:07:22 +08:00
Yi Ming
bbd0fdd36d perf(lsp): avoid unnecessary string allocations when parsing content-length 2026-04-25 19:02:06 +08:00
Yi Ming
1235c956ca refactor: support buf:ref() in stringbuffer shim 2026-04-25 19:02:06 +08:00
Olivia Kinnear
fb795cee3e fix(build): add _core/time.lua to gettext #39384 2026-04-25 05:24:43 -04:00
zeertzjq
df8cf0ed25 test: add finally() to meta file (#39388) 2026-04-25 16:47:48 +08:00
Tristan Knight
f83d0b9653 fix(lsp): handle self-mapped methods in supports_method #39383
Problem:
The LSP client incorrectly checks for server capabilities when determining
support for self-mapped methods (e.g., 'shutdown'), which do not have
corresponding capabilities in the server's response. This leads to false
negatives when checking if such methods are supported.
This was handled correctly for dynamic registrations, but not for static.

Methods such as 'shutdown', do not have a related server capability and should
be assumed to be supported.

Solution:
Update the `supports_method` logic to always return true for self-mapped
methods.
2026-04-24 18:48:23 -04:00
Kyle
66149ca668 feat(tui): restore 'ttyfast' to control tty requests #38699
Problem:
When running nvim on a remote machine over SSH, if there is high ping,
then bg detection may not complete in time. This results in a warning
every time nvim is started. #38648

Solution:
Restore 'ttyfast' option and allow it to control whether or not bg
detection is performed. Because this is during startup and before any
user config or commands, we use the environment variable
`NVIM_NOTTYFAST` to allow disabling `ttyfast` during initialization.
2026-04-24 14:45:20 -04:00
Barrett Ruth
393f687503 fix(api): leak preview callback LuaRef in nvim_create_user_command #39357
Problem:
Invalid `nvim_create_user_command` calls can leak the
`preview` callback reference after Neovim has taken ownership of it.

1. build with {a,l}san
2. run:
    ```sh
    <path/to/nvim> --headless -u NONE --clean +'lua
    for i = 1, 100 do
      pcall(vim.api.nvim_create_user_command,
        "some very epic stuff" .. i,
        {}, -- NOTE: this is INVALID (not a function or string)
        { preview = function() end })
    end
    vim.cmd("qa!")
    ' +qa
    ```
3. see:
    ```
    100 lua references were leaked!
    ```

Solution:
Clear `preview_luaref` in `err:`.
2026-04-24 14:13:24 -04:00
Barrett Ruth
58aad59e1c fix(api): LuaRef leak in nvim_set_keymap on LHS too long (>=66 bytes) #39351
Problem: `nvim_set_keymap` leaks the `callback` `LuaRef` when the
LHS is too long.

Solution: Make `set_maparg_lhs_rhs` transfer `rhs_lua` to
`MapArguments` up front so the caller always owns the ref.
2026-04-24 14:10:28 -04:00
tao
f130922744 fix(path): normalize path slashes on Windows #37729
Problem:
On Windows, path separators may become inconsistent for various reasons,
which makes normalization quite painful.

Solution:
Normalize paths to `/` at the entry boundaries and always use it
internally, converting back only in rare cases where `\` is really
needed (e.g. cmd.exe/bat scripts?).

This is the first commit in a series of incremental steps.

Note:
* some funcs won't respect shellslash. e.g. `expand/fnamemodify`
* some funcs still respect shellslash, but will be updated in a follow
  PR. e.g. `ex_pwd/f_chdir/f_getcwd`
* uv's built-in funcs always return `\`. e.g. `uv.cwd/uv.exepath`

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-04-24 13:20:25 -04:00
Peter Cardenas
27191e0f4f feat(api): nvim_echo(percent=nil) means "unknown" progress #39029
Problem:
No way to signal "unknown" or "indeterminate" progress percentage.

Solution:
Treat percent=nil as "indeterminate" percent.
2026-04-24 11:57:35 -04:00
glepnir
a57fab2f2d test: curbuf initialized in describe-block #39365
Problem: curbuf was initialized at describe-block load time
before any Nvim session existed.

Solution: Replace with 0 directly at call sites.
2026-04-24 09:30:33 -04:00
Justin M. Keyes
2c7679f4d3 fix(lsp): more info in error msg, deduplicate test #39359 2026-04-24 07:40:33 -04:00
Justin M. Keyes
5c88492a13 fix(trust): always use "/" slashes in filepaths #39355
Problem:
We should not use "\" (backslashes) except where absolutely required.
See references in https://github.com/neovim/neovim/pull/37729

Solution:
There is no reason to use "\" slashes in the trust db, so don't.
2026-04-24 07:37:21 -04:00