Commit Graph

10545 Commits

Author SHA1 Message Date
Justin M. Keyes
52d466c500 Merge #38882 docs 2026-04-12 08:45:46 -04:00
Barrett Ruth
6e95d1ad13 fix(normal): pass count to 'keywordprg' as arg1 #38965
Problem:
If `'keywordprg'` begins with `:`, `3K` turns the count into an Ex
range. Commands that don't support that then fail. Vim passes the count
as the first arg (see #19436, vim/vim#10745).

Solution:
Pass `[count]` as the first arg for `'keywordprg'`.
2026-04-12 08:44:56 -04:00
glepnir
49086862fc fix(api): nvim_get_hl drops groups defined with link_global #38492
Problem: hlgroup2dict passes &ns_id to ns_get_hl twice. The first call
(link=true) sets *ns_hl = 0 when link_global is set, so the second call
and the sg_cleared guard both see ns_id == 0 and bail out. The group is
silently dropped from the result.

Solution: use a temporary copy of ns_id for each ns_get_hl call so the
original value is preserved.
2026-04-12 08:38:35 -04:00
Justin M. Keyes
30a80cbd7c docs: vim.pos 2026-04-12 14:17:50 +02:00
Justin M. Keyes
a321c9adad docs: misc
Close #38748
Close #38866

Co-authored-by: Mario Loriedo <mario.loriedo@gmail.com>
Co-authored-by: Anakin Childerhose <anakin@childerhose.ca>
2026-04-12 14:17:50 +02:00
zeertzjq
fa22a78d2a vim-patch:86ae685: runtime(jjdescription): allow to configure summary width (#38972)
Allow to configure max length for the summary line and fall back to gits
setting.

closes: vim/vim#19905

86ae6858ab

Co-authored-by: Emilia <emilia@bewitching.dev>
2026-04-12 08:00:51 +08:00
skewb1k
38aec2d3cd fix(pack): make 'stash' call compatible with older Git #38679
Problem:
On Git versions 2.13..2.26 there is a bug that prevents using
`stash --message`.

Solution:
Use the full `stash push --message` form to avoid that bug.
2026-04-11 10:37:37 -04:00
glepnir
af9a72d8c1 fix(lsp): check stale context in hover/signature callback #38724
Problem: hover/signature callback lacked consistency checks, so slow LSP servers
could open a float after the cursor had already moved away.

Solution: guard the callback with buf validity, buf version, and cursor
position checks before opening the float. Also fix table capacity calculation.
2026-04-11 10:32:56 -04:00
Jaehwang Jung
417d16df50 fix(lsp): codelens text flickers #38782
Problem:
When a new textDocument/codeLens response arrives with unresolved lenses,
on_win clears the existing codelens row before codeLens/resolve
completes. This causes the displayed codelens text to flicker while
typing.

Solution:
Keep the current virtual lines if any of the refreshed lenses are still
unresolved. Clear the old virtual lines only when the line no longer has
lenses or all its lenses are resolved.

A trade-off is that the user may temporarily see outdated codelenses.
However, that's preferable to spamming updates on every refresh.

AI-assisted: Codex
2026-04-11 10:27:11 -04:00
Jan Edmund Lazo
08f9bf5d26 vim-patch:8.2.2958: function list test fails
Problem:    Function list test fails.
Solution:   Add newly added function to the list.  Fix typo.

f7a023e580

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-04-11 02:47:31 -04:00
zeertzjq
c4b592a6d0 vim-patch:9.2.0333: filetype: PklProject files are not recognized (#38949)
Problem:  filetype: PklProject files are not recognized
Solution: Detect PklProject files as pkl filetype
          (Nihaal Sangha).

Reference:
https://pkl-lang.org/
https://github.com/apple/pkl
https://github.com/apple/pkl-pantry

closes: vim/vim#19948

871e6c6cf9

Co-authored-by: Nihaal Sangha <nihaal.git@gmail.com>
2026-04-11 08:05:43 +08:00
Justin M. Keyes
843a7223e7 Merge #38501 :log, stdpath("state")/logs 2026-04-10 12:38:38 -04:00
Olivia Kinnear
8715877417 feat(ex): add :log command 2026-04-10 11:08:26 -05:00
Evgeni Chasnovski
94c0e54e5b fix(pack): more advice for out-of-sync lockfile #38931
Problem: If the lockfile points to the revision that is not on disk, the
  `:checkhealth vim.pack` suggests to run `vim.pack.update()`. Although
  usually it should resolve the problem, it is not always the case: like
  if the state on disk is already the latest available.

Solution: Add an extra suggestion with a more drastic measure by
  manually removing `rev` field from the lockfile for it to be repaired
  after the `:restart`.
2026-04-10 11:36:04 -04:00
Maria Solano
c1c2648284 feat(snippet): support multiple sessions #29340 2026-04-10 10:08:10 -04:00
Ellison
45f50d238a feat(vim.net): custom request() headers #38837
Problem
Cannot specify headers in vim.net.request() call.

Solution
Support opts.headers in vim.net.request opts.
2026-04-10 09:55:57 -04:00
zeertzjq
ec8d352117 vim-patch:9.2.0326: runtime(tar): but with dotted path
Problem:  runtime(tar): but with dotted path
Solution: Do not strip everything after the first dot
          (Aaron Burrow)

tar#Extract was getting the extensionless basename by
stripping away everything starting with the leftmost
dot.  So if a directory had a dot or the file had an
'extra' dot then the code did the wrong thing.  For
example, if it was given:

  /tmp/foo.bar/baz.tar.gz

Then it would treat /tmp/foo as the extensionless
basename, but it actually should have grabbed:

  /tmp/foo.bar/baz

This patch fixes the issue by instead looking at the
rightmost dot(s).

This bug was discovered by ChatGPT 5.4.  I wrote the
patch and tested vim.

closes: vim/vim#19930

4a1bcc67b4

Co-authored-by: Aaron Burrow <burrows@fastmail.com>
2026-04-10 12:30:38 +08:00
zeertzjq
dc3b49d5a1 vim-patch:9.2.0325: runtime(tar): bug in zstd handling
Problem:  patch 9.2.0325: runtime(tar): bug in zstd handling
Solution: use correct --zstd argument, separated from other arguments,
          rework testing framework (Aaron Burrow).

The tar.vim plugin allows vim to read and manipulate zstd archives,
but it had a bug that caused extraction attempts to fail.
Specifically, if the archive has a .tar.zst or .tzst extension, then
the code was generating invalid extraction commands that looked like
this:

  tar --zstdpxf foo.tar.zst foo

When they should be like this:

  tar --zstd -pxf foo.tar.zst foo

This patch changes the flag manipulation logic so that --zstd isn't
glued to pxf.

The labor for this change was divided between ChatGPT 5.4 and me.
ChatGPT 5.4 identified the issue (from a code scan?), and I wrote
the patch and tested vim.

related: vim/vim#19930

00285c035a

Note: tests need the next patch to pass in Nvim.

Co-authored-by: Aaron Burrow <burrows@fastmail.com>
2026-04-10 12:30:31 +08:00
Olivia Kinnear
6bea0cdbdc feat(logs)!: move logs to stdpath("state")/logs 2026-04-09 21:54:33 -05:00
zeertzjq
d8aafb20e1 vim-patch:f554a7c: runtime(jjdescription): Add highlighting for 'Renamed' status lines
`jj status` output uses the 'R' prefix for renamed files.

closes: vim/vim#19879

f554a7c709

Co-authored-by: Joël Stemmer <jstemmer@google.com>
2026-04-10 09:59:37 +08:00
zeertzjq
08118fe6f2 vim-patch:9598174: runtime(jjdescription): Anchor status matches to start of line
The regex for status line highlighting was too broad, `jjComment` lines
containing e.g. the letter 'A' followed by a space anywhere in the line
were highlighted.

related: vim/vim#19879

959817472d

Co-authored-by: Joël Stemmer <jstemmer@google.com>
2026-04-10 09:59:19 +08:00
zeertzjq
b10ae3b72b vim-patch:72cefe6: runtime(help): support highlighting groups in translated syntax doc (#38922)
closes: vim/vim#19942

72cefe6b72

Also include a blank line change from 9d9381fb28

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-04-10 08:23:48 +08:00
zeertzjq
93b3ea26ac vim-patch:9.2.0327: filetype: uv scripts are not detected (#38920)
Problem:  filetype: uv scripts are not detected
          (Asger Hautop Drewsen)
Solution: Detect uv scripts as python filetype if the shebang line
          contains "uv run"

Reference:
https://docs.astral.sh/uv/guides/scripts/#using-a-shebang-to-create-an-executable-file

fixes: vim/vim#19941

6c16ccaf61

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-10 07:28:24 +08:00
Yi Ming
f9e068117b refactor(lsp): share code by get_locations #38902
Problem:
`vim.lsp.buf.definition`/`vim.lsp.buf.declaration` use the same underlying code
via `get_locations`, whereas `vim.lsp.buf.reference` does not. This is because
`buf.reference` does not perform a jump when there is only one item.

Solution:
In #38510, I simplified the jump logic using `:cfirst`, so they can now share
code more easily. Additionally, this PR enables `buf.definition` to display the
corresponding qflist name.
2026-04-09 13:46:50 -04:00
Luis Calle
24811c0a14 fix(vim.pos): Range:intersect() drops buf #38898
new() only supports nargs=5 or nargs=2, but this was passing 4 args.
2026-04-09 11:01:28 -04:00
zeertzjq
9c5fba5df0 fix(messages): truncate warning messages only in display (#38901)
For now, add a private "_truncate" flag to nvim_echo, using a truncation
method similar to showmode().
2026-04-09 04:11:32 +00:00
Jordan
3a4a66017b feat(api): rename buffer to buf #35330
Problem:
`:help dev-name-common` states that "buf" should be used instead of
"buffer" but there are cases where buffer is mentioned in the lua API.

Solution:
- Rename occurrences of "buffer" to "buf" for consistency with the
  documentation.
- Support (but deprecate) "buffer" for backwards compatibility.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-04-08 20:34:47 -04:00
zeertzjq
eefb50e352 vim-patch:9.2.0323: filetype: buf.lock files are not recognized (#38897)
Problem:  filetype: buf.lock files are not recognized
Solution: Detect buf.lock files as yaml filetype
          (Stefan VanBuren)

Reference:
https://buf.build/docs/configuration/v2/buf-lock/

closes: vim/vim#19935

c2734dc03c

Co-authored-by: Stefan VanBuren <svanburen@buf.build>
2026-04-08 23:11:20 +00:00
glepnir
6473d007e7 fix(lsp): apply_text_edits causes unwanted BufDelete events #38778
Problem:
Since 2f6d1d3c88, `apply_text_edits`
unconditionally sets `buflisted=true`, causing spurious BufDelete events
if plugins restore the original 'buflisted' state on unlisted buffers:
65ef6cec1c/src/nvim/option.c (L2159-L2169)

Solution:
- Don't set 'buflisted' in `apply_text_edits`. Set it more narrowly, in
  `apply_workspace_edit` where the semantics requires affected buffers
  to be visible to the user.
- Also skip setting 'buflisted' if it would not be changed, to avoid
  redundant `OptionSet` events.
2026-04-08 17:10:52 -04:00
Sean Dewar
1ff1973269 fix(api)!: nvim_clear_autocmds() "event" handling
Problem: nvim_clear_autocmds() does not type check "event" correctly, and also
treats an empty array "event" like nil.

Solution: fix type checking. Treat empty array "event" as a no-op, like
nvim_exec_autocmds(). Add some extra tests.

Likewise the nil handling change may be considered breaking if anyone
(unintentionally) relied on that. It was also true that integer, function, etc.
"event"s would also be treated like nil!

Note that an empty string "event" is still an error, as that's must be an exact
match on an event name.
2026-04-08 21:48:38 +01:00
Sean Dewar
eaea0c0f9d docs(api): nvim_exec_autocmds() default "pattern"
Problem: nvim_exec_autocmds() documentation incorrectly describes the default
for "pattern" as *, when it's actually the current file name (like :doautocmd).

Solution: correct it. Add a test.
2026-04-08 21:48:38 +01:00
Sean Dewar
446e794a9c fix(api)!: empty non-nil autocmd "pattern" handling
Problem: in autocmd APIs, a non-nil "pattern" containing only empty
'sub'-patterns is silently treated as nil, causing the fallback value to be
unexpectedly used instead.

Solution: for nvim_create_autocmd(), raise a validation error (as no autocmds
would be created). For nvim_{exec,clear}_autocmds(), make it a no-op (as
matching no autocmds is not an error).
2026-04-08 21:48:38 +01:00
Maria Solano
665ebce569 fix(diagnostics)!: restore is_pull namespace argument #38698
Problem:
The current LSP diagnostic implementation can't differ between a pull
diagnostic with no identifier and a set of diagnostics provided via push
diagnostics.

"Anonymous pull providers" are expected by the protocol https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticOptions
, depending on how the capability was registered:
- Dynamic registrations have an identifier.
- Static registrations will not.

Solution:
Restore the `is_pull` argument removed in
https://github.com/neovim/neovim/pull/37938, keeping the identifier of
pull diagnostic collections.
2026-04-08 16:11:01 -04:00
ngicks
a165eee64f feat(vim.version): add __eq to vim.VersionRange #38881
Problem: vim.VersionRange had no __eq metamethod, so comparing 2 distinct
but same value instances always returned false. In vim.pack.add this caused
redundant lockfile rewrites, even when the resulting lockfile content was
unchanged.

Solution: Add __eq metamethod on vim.VersionRange
2026-04-08 13:33:00 -04:00
Justin M. Keyes
7e4d484c9d refactor(filetype): move _get_known_filetypes, return a Set #38886
- `_get_known_filetypes` may be useful for other internal code, so move
  it to an internal function.
- Use a set instead of a list, for performance.
2026-04-08 13:31:37 -04:00
Barrett Ruth
20a3254ad4 fix(health): misleading warnings re filetypes registered w/ vim.filetype.add() #38867
Problem:
`:checkhealth vim.lsp` validates configured filetypes against
`getcompletion('', 'filetype')`. This only reflects runtime support
files.

This causes false warnings in `:checkhealth vim.lsp` for configured
filetypes that are known to the Lua filetype registry, including
values added with `vim.filetype.add()` and built-in registry-only
filetypes.

Solution:
Build the healthcheck's known-filetype set from both
`getcompletion('', 'filetype')` and `vim.filetype.inspect()`.
2026-04-08 12:30:35 -04:00
Luis Calle
c530fd8e75 docs: vim.range, vim.pos #38869
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.
2026-04-08 11:38:27 -04:00
Dan Drennan
65ef6cec1c fix(health): recognize Zig build optimization levels #38804
Problem: When Neovim is built with Zig, `:checkhealth` falsely reports
"Non-optimized debug build" for release builds. The extraction regex
stops at the first space, and the validation regex only lists CMake
build type names.

Solution: Fix the extraction regex to capture the full build type string
and add Zig optimization levels (ReleaseFast, ReleaseSafe, ReleaseSmall)
to the validation regex.

AI-assisted: Claude Code
2026-04-08 04:33:26 -04:00
zeertzjq
399fe4a11f vim-patch:f3cba4a: runtime(doc): document gitcommit_summary_length
related: vim/vim#19905

f3cba4a205

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-08 07:23:20 +08:00
zeertzjq
87947a4e96 vim-patch:15e9888: runtime(bitbake): Update syntax script
1) add syntax for include_all

The include_all directive was introduced in [1]. It uses the same syntax
as include or require, taking one or more paths as argument.

2) add syntax for inherit_defer

The inherit_defer directive was introduced in [2]. It uses the same syntax
as inherit, taking one or more class name as argument.

3) add syntax for addpylib

The addpylib directive was introduced in [3]. It uses a syntax similar
to addtask or addhandler, taking a directory and python namespace as
argument.

[1]: https://git.openembedded.org/bitbake/commit/?id=d01d5593e7829ac60f37bc23cb87dc6917026471
[2]: https://git.openembedded.org/bitbake/commit/?id=5c2e840eafeba1f0f754c226b87bfb674f7bea29
[3]: https://git.openembedded.org/bitbake/commit/?id=afb8478d3853f6edf3669b93588314627d617d6b

15e988810e

Co-authored-by: Antonin Godard <antonin@godard.cc>
2026-04-08 07:22:58 +08:00
Tomas Slusny
382a1c40c2 fix(difftool): ensure standardized locale for diff output parsing #38853
Always pass LC_ALL=C to diff when parsing its output.

Closes #38838

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2026-04-07 13:02:11 -04:00
zeertzjq
b36eafd5da vim-patch:794c304: runtime(doc): clarify incsearch feature and typed chars (#38830)
fixes: vim/vim#19886

794c304479

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-07 06:22:45 +08:00
glepnir
af707dd242 fix(diagnostic): virtual_lines should anchor at end_lnum, not lnum #38701
Problem: Multi-line diagnostics always render virtual lines below lnum.

Solution: Use end_lnum when placing the virt_lines extmark.
2026-04-06 13:22:39 -04:00
Christian Clason
bdc72a0843 feat(filetype): vim.filetype.inspect() returns copy of registry #38831
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.
2026-04-06 12:48:42 -04:00
Josh Triplett
889572a358 fix(tui): check background color on resume #38726
Problem:
We normally get the background color via continuous reporting. However,
if we were backgrounded while the light/dark mode changed, we won't have
received the report, and we'll have the wrong background color.

Without this change, if you background nvim, toggle the light/dark mode,
resume, and check `:set bg`, it will not match the current state.

Solution:
Query it on resume as well. (This requires separating the query from the
flush, to just do the query along with all the others, while waiting to
flush until we've set up uv.)

With this change, if you background nvim, toggle the light/dark mode,
resume, and check `:set bg`, it will have updated.
2026-04-06 12:44:03 -04:00
Luis Calle
01be30f638 feat(vim.pos)!: require buf param on vim.pos, vim.range #38665
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
2026-04-06 11:51:36 -04:00
zeertzjq
595e58f47f vim-patch:f1dbca2: runtime(log): clean up and modernize log syntax (#38827)
- Rename groups to consistent log* naming (LogString→logString, etc.)
- Remove redundant logOperator/logBrackets, use logSymbol for special chars
- Simplify level keywords by removing case variants
- Consolidate syslog column patterns into logSysColumn
- Move custom highlights to portable ctermfg/guifg names
- Update maintainer email address

closes: vim/vim#19917

f1dbca200c

Co-authored-by: Mao-Yining <mao.yining@outlook.com>
2026-04-06 13:50:33 +00:00
zeertzjq
056304ef5b vim-patch:9.2.0306: runtime(tar): some issues with lz4 support (#38826)
Problem:  runtime(tar): some issues with lz4 support
Solution: Fix bugs (see below) (Aaron Burrow)

The tar plugin allows users to extract files from tar archives that are
compressed with lz4. But, tar#Extract() builds malformed extraction commands
for lz4-compressed tar archives. This commit fixes three issues in that code.
The first affects archives with a .tlz4 extension and the other two affect
archives with .tar.lz4 extension (but one of these is symmetric to the issue
that .tlz4 archives had).

(1) When trying to extract .tlz4 archives the command created by
tar#Extract looked like this:

    tar -I lz4pxf foo.tlz4 foo

This isn't right.  It should be something like this:

    tar -I lz4 -pxf foo.tlz4 foo

This was happening because tar.plugin is just substituting on the
first - in "tar -pxf".  This works fine if we just add a simple flag for
extraction (eg, z for .tgz), but for lz4 we need to add "-I lz4".

I don't believe that there is an obvious good way to fix this without
reworking the way the command is generated.  Probably we should collect
the command and flags separately and the flags should be stored in a
set. Then put everything together into a string just before issuing it
as an extraction command.  Unfortunately, this might break things for users
because they have access to tar_extractcmd.

This patch just makes the substitution a little bit more clever so that it
does the right thing when substituting on a string like "tar -pxf".

(2) .tar.lz4 extractions had the same issue, which my patch fixes in
the same way.

(3) .tar.lz4 extractions had another issue.  There was a space missing
in the command generated by tar#Extract.  This meant that commands
looked like this (notice the lack of space between the archive and output
file names):

    tar -I lz4pxf foo.tar.lz4foo

This patch just puts a space where it should be.

Finally, I should note that ChatGPT 5.4 initially identified this issue
in the code and generated the test cases.  I reviewed the test cases,
wrote the patch, and actually ran vim against the tests (both with and
without the patch).

closes: vim/vim#19925

78954f86c2

Co-authored-by: Aaron Burrow <burrows@fastmail.com>
2026-04-06 13:43:28 +00:00
zeertzjq
4aa8969d29 vim-patch:9.2.0299: runtime(zip): may write using absolute paths (#38810)
Problem:  runtime(zip): may write using absolute paths
          (syndicate)
Solution: Detect this case and abort on Unix, warn in the documentation
          about possible issues

46f530e517

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-06 10:15:19 +08:00
Justin M. Keyes
42f6c55139 Merge #38796 from justinmk/doc2 2026-04-05 20:36:45 -04:00