Commit Graph

36187 Commits

Author SHA1 Message Date
Evgeni Chasnovski
42e9d8dfd1 docs(pack): improve "Synchronize across machines" steps #39122
Problem: Sometimes automatic lockfile synchronization after `:restart`
  might fail, like due to bad/absent Internet connection. This would
  remove failed to install entries from the lockfile (since they are not
  on disk and lockfile is meant to lock the latest plugin version on
  disk).

Solution: Document that this should be treated as an unwanted update and
  use steps similar to "Revert plugin after an update" use case.
2026-04-16 10:33:20 -04:00
Evgeni Chasnovski
711f3cc299 docs(diagnostic): severity names are sometimes allowed #39120
Problem: Using severity names (like "ERROR", "WARN") in functions like
  `vim.diganostic.get()` and `vim.diagnostic.config()` is allowed and
  tested for many years now. But documentation about it can be clearer.

Solution: Explicitly mention that severity names are allowed in some
  situations. Ideally, it would also require updating typing for
  `vim.diagnostic.SeverityFilter`, but that looks problematic to do
  robustly.
2026-04-16 10:32:35 -04:00
zeertzjq
3cca237984 vim-patch:e6a84bb: runtime(tar): missing g:tar_secure in tar#Extract() (#39123)
e6a84bb6b0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-16 22:19:48 +08:00
dependabot[bot]
c564bcdef6 ci: bump actions/github-script from 8 to 9 in the github-actions group across 1 directory (#39121)
ci: bump actions/github-script

Bumps the github-actions group with 1 update in the / directory: [actions/github-script](https://github.com/actions/github-script).


Updates `actions/github-script` from 8 to 9
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v8...v9)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '9'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-16 10:12:48 -04:00
Evgeni Chasnovski
df6a0827fb test(pack): increase retry timeout for startup test #39125
Problem: Unreliable test on Windows which sometimes fails with too many
  failed retries.

Solution: Increase timeout in hopes that it will be enough to make it
  pass more frequently. This should not affect fast and already working
  platforms.
2026-04-16 10:11:34 -04:00
Justin M. Keyes
11a1ec7df3 test: lint naming conventions #39117
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.
2026-04-16 09:35:58 -04:00
luukvbaal
5b0ad4a060 fix(float): don't unload 'hidden' float buffer with :close! (#39096)
Problem:  When closing floating windows to close a tabpage, if the current
          buffer will unload, buffers contained in those floating windows
          will too (unexpectedly).
Solution: Don't pass along "free_buf" argument; check 'bufhidden' for
          the buffer in the to be closed float.
2026-04-16 11:43:27 +02:00
Justin M. Keyes
6b1a918038 Merge #39078 render class dot members as module functions 2026-04-16 05:42:33 -04:00
purrtc0l
e56deecf00 docs(l10n): fix fuzzy zh_CN translations #39109
Problem:
Several zh_CN translations were marked fuzzy with wrong or placeholder msgstr.

Solution:
Fix fuzzy entries, preserve format specifiers, use full-width punctuation.
2026-04-16 05:16:57 -04:00
Yi Ming
37aa66c1a2 feat(docs): render class dot members as module functions
AI-assisted: Codex
2026-04-16 16:50:36 +08:00
Barrett Ruth
3838a2579e fix(treesitter): restore highlighting on 32 bit systems #39091
Problem: Treesitter highlighting regressed on 32-bit builds because ranges that should cover the whole buffer were corrupted when passed into Lua.

Solution: Round-trip those range values through Lua and validate them so treesitter sees the same ranges on 32 and 64-bit builds.
2026-04-16 03:59:20 -04:00
Luis Calle
530cfa1323 refactor(lsp): fix typing for LSP methods #39099
Problem
Some variables use the wrong type (ClientToServer instead of ServerToClient)
and some use vaguer types that could be more strict.

Solution
Use the correct types.
2026-04-16 03:57:13 -04:00
zeertzjq
0e07b2a1e2 vim-patch:9.2.0357: [security]: command injection via backticks in tag files (#39102)
Problem:  [security]: command injection via backticks in tag files
          (Srinivas Piskala Ganesh Babu, Andy Ngo)
Solution: Disallow backticks before attempting to expand filenames.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-cwgx-gcj7-6qh8

Supported by AI

c78194e41d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-16 11:11:29 +08:00
zeertzjq
8af2ba74a4 vim-patch:9.2.0351: repeat_string() can be improved (#39101)
Problem:  repeat_string() can be improved
Solution: Replace the for() loop by an exponential growing while loop
          (Yasuhiro Matsumoto)

closes: vim/vim#19977

bfa46a52f6

Cherry-pick f_repeat() refactor from patch 9.1.1232.

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-04-16 11:11:04 +08:00
zeertzjq
a90c3e382d Merge pull request #39100 from zeertzjq/vim-2041478
vim-patch: Fix Bitbake varflag detection
2026-04-16 11:08:44 +08:00
zeertzjq
766efe5b51 vim-patch:9.2.0354: filetype: not all Bitbake include files are recognized
Problem:  filetype: not all Bitbake include files are recognized
Solution: Enhance the file detection logic and consider varflags
          (Martin Schwan)

closes: vim/vim#19983

0e02be1919

Co-authored-by: Martin Schwan <m.schwan@phytec.de>
2026-04-16 10:28:01 +08:00
zeertzjq
e7f83fad39 vim-patch:2041478: runtime(bitbake): support forward-slashes in bitbake varflags
Enable syntax highlighting for forward-slashes in Bitbake variables with
varflags. Bitbake allows for forward-slashes in both the variable name
and their potential varflags. E.g. the following should match:

    FOO_BAR[baz] = "foobar"
    FOO_BAR_foo/bar[baz] = "foobar"
    FOO_BAR_foo/bar[baz/bazzer] = "foobar"

Also allow plus-signs in variable names, to be in line with normal
variable names.

related: vim/vim#19983

2041478e2a

Co-authored-by: Martin Schwan <m.schwan@phytec.de>
2026-04-16 10:28:00 +08:00
zeertzjq
c3c06723f0 vim-patch:9.2.0355: runtime(tar): missing path traversal checks in tar#Extract() (#39095)
Problem:  runtime(tar): missing path traversal checks in tar#Extract()
Solution: Add check for leading slash, however gnu tar should already
          detect this (q1uf3ng)

tar#Extract() did not check for ../ sequences or absolute paths,
unlike zip#Extract() which was patched in recent commits. Add the
same checks: ../ (relative traversal), leading slash (Unix), drive
letter and UNC/leading slash (Windows).

closes: vim/vim#19981

490b737f3e

Co-authored-by: q1uf3ng <q1uf3ng@protone.me>
2026-04-16 08:40:41 +08:00
zeertzjq
56ed27d718 vim-patch:351a16c: runtime(zip): also block single leading slash and absolute paths in Extract (#39094)
zip#Write(): the Windows path check did not match a single leading
slash (/path), which resolves to the current drive root on Windows.
Simplify the regex to match any leading slash or backslash.

zip#Extract(): add absolute path checks for both Unix and Windows,
matching the existing checks in zip#Write().

closes: vim/vim#19976

351a16c88f

Co-authored-by: q1uf3ng <q1uf3ng@protone.me>
2026-04-16 08:40:27 +08:00
Raizento
d2fff0590a fix(lsp): set 'winfixbuf' in open_floating_preview() window #39058
Problem:
The window opened by `vim.lsp.util.open_floating_preview()`
allows its buffer to be switched. Presumably that only happens
by accident and is disorienting.

Solution:
Set 'winfixbuf' in the open_floating_preview() window.
2026-04-15 17:14:35 -04:00
Justin M. Keyes
646ce85aa5 refactor: update usages of deprecated "buffer" param #39089 2026-04-15 18:45:26 +00:00
Justin M. Keyes
71ac4db335 refactor(api): rename "window" to "win" (positional parameters) #39083
continues d0af4cd909.

This commit renames positional parameters. This is only "cosmetic", but
is intended to make it extra clear which name is preferred, since people
often copy existing code despite the guidelines in `:help dev-naming`.
2026-04-15 13:31:17 -04:00
Yi Ming
1740d51ede feat(lsp): highlight foldtext via treesitter #38789
Problem:
To support `collapsedText`, which allows the LSP server to determine the
content of the foldtext, we provided `vim.lsp.foldtext()`. However, such
content does not have highlighting.

Solution
Treat the filetype of `collapsedText` as the filetype of the corresponding
buffer and use tree-sitter to highlight it.
2026-04-15 10:27:44 -04:00
Justin M. Keyes
d0af4cd909 refactor(api): rename buffer to buf (positional parameters) #39013
In 3a4a66017b, 4d3a67cd62, df8d98173c we renamed "buffer" to "buf"
in dict parameters and return-values.

This commit renames positional parameters. This is only "cosmetic", but
is intended to make it extra clear which name is preferred, since people
often copy existing code despite the guidelines in `:help dev-naming`.
2026-04-15 09:48:21 -04:00
Lewis Russell
1f53abf54b refactor(diagnostic): split diagnostic module
Extract the diagnostic implementation from
runtime/lua/vim/diagnostic.lua into focused internal modules covering
config, display, float rendering, jump/list helpers, namespace and
storage management, severity/shared utilities, and statusline support.

Move the builtin handlers into runtime/lua/vim/diagnostic/handlers/ and
keep runtime/lua/vim/diagnostic.lua as the public facade that lazily
dispatches to the split modules. This preserves the external
vim.diagnostic API while making the implementation easier to navigate
and reason about.

AI-assisted: Codex
2026-04-15 14:44:13 +01:00
Lewis Russell
9e80f63c30 Merge pull request #38486 from lewis6991/testharnes 2026-04-15 14:43:11 +01:00
Yi Ming
481e70550c revert: "docs: vim.range, vim.pos #38869"
This reverts commit c530fd8e75.
2026-04-15 20:46:46 +08:00
Lewis Russell
55f9c2136e test: replace busted with local harness
Replace the busted-based Lua test runner with a repo-local harness.

The new harness runs spec files directly under `nvim -ll`, ships its own
reporter and lightweight `luassert` shim, and keeps the helper/preload
flow used by the functional and unit test suites.

Keep the file boundary model shallow and busted-like by restoring `_G`,
`package.loaded`, `package.preload`, `arg`, and the process environment
between files, without carrying extra reset APIs or custom assertion
machinery.

Update the build and test entrypoints to use the new runner, add
black-box coverage for the harness itself, and drop the bundled
busted/luacheck dependency path.

AI-assisted: Codex
2026-04-15 12:09:25 +01:00
zeertzjq
202e17deef vim-patch:9.2.0346: Wrong cursor position when entering command line window (#39072)
Problem:  Wrong cursor position when entering command line window
Solution: Add check_cursor() command to verify the cursor position
          (Hirohito Higashi).

When opening the command-line window with CTRL-F after typing a command
that fills the screen width, the cursor was placed past the end of the
line.  Add check_cursor() after setting State to MODE_NORMAL so the
cursor is adjusted to the last character.

Also fix the cmdwin prefix character (e.g. ':') being drawn on wrapped
continuation rows.  Draw an empty space instead so that the text
alignment is preserved.

closes: vim/vim#19964

c4fe1e958a

Cherry-pick Test_wildmenu_pum() changes from patch 9.1.1995.

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:22:05 +08:00
Lewis Russell
e289f9579c fix(lua): make vim.deep_equal cycle-safe
AI-assisted: Codex
2026-04-15 09:26:45 +01:00
Lewis Russell
08ecb3a734 test(vterm): retain ffi callback structs
AI-assisted: Codex
2026-04-15 09:26:45 +01:00
glepnir
92317013b4 refactor: move e_invalwindow to errors.h (#39067)
Problem: e_invalwindow was a static local, inconsistent with other error strings.

Solution: Convert it to EXTERN/INIT style and move it to errors.h.
2026-04-15 11:59:07 +08:00
zeertzjq
e0eb967f8a vim-patch:partial:9.2.0348: potential buffer underrun when setting statusline like option (#39063)
Problem:  potential buffer underrun when settings statusline like option
          (q1uf3ng)
Solution: Validate that p > out before accessing p[-1]

closes: vim/vim#19961

91b402f575

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-14 23:59:17 +00:00
zeertzjq
8fdac3d08d vim-patch:9.2.0343: tests: test_clientserver may fail on slower systems
Problem:  tests: test_clientserver may fail on slower systems
Solution: Wait for argc() before checking argv() (James McCoy).

On slower systems, the argv() check may run before the server has
populated the arg list.

Add a wait for argc() to be 3 to be more tolerant of such systems

closes: vim/vim#19974

9d95410aa4

Co-authored-by: James McCoy <jamessan@jamessan.com>
2026-04-15 07:21:21 +08:00
zeertzjq
504aa9253a vim-patch:9.2.0342: tests: test_excmd.vim leaves swapfiles behind
Problem:  tests: test_excmd.vim leaves swapfiles behind
Solution: Close open buffer using :bw!

related: vim/vim#19975

c922202ea2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-15 07:21:21 +08:00
zeertzjq
65680f59d1 vim-patch:9.2.0345: Wrong autoformatting with 'autocomplete' (#39060)
Problem:  Wrong autoformatting with 'autocomplete'.
Solution: Don't trigger autoformatting when ending autocompletion
          without selecting an item (zeertzjq).

fixes:  vim/vim#19954
closes: vim/vim#19970

efbd482116
2026-04-14 23:03:34 +00:00
Barrett Ruth
e827c3b648 fix(gf): handle local file: URI paths #38915
Problem:
`gf` and `<cfile>` treat `file:/absolute/path` as a literal path and
open `file:/...` instead of the local file.

Solution:
Strip the local `file:` prefix before path resolution in the hyperlink
path code.
2026-04-14 18:08:09 -04:00
luukvbaal
5d3cda472c feat(api): use zindex to determine dimmed cursor shape #39054
Problem:  The cursor shape is changed to indicate when it is behind an
          unfocused floating window (since a2b92a5e). This behavior
          cannot be controlled by a floating window that doesn't want
          to dim the cursor.

Solution: Assign a zindex-offset of 50 to the zindex of the current
          window. To not dim the cursor when creating a floating window
          on top of the current window one can assign the zindex
          accordingly.
2026-04-14 16:08:36 -04:00
Justin M. Keyes
87b5062f94 Merge #36500 ci: update clang to version 21 2026-04-14 13:22:01 -04:00
Justin M. Keyes
91eb6399e9 Merge #39031 appimage, rename org.neovim.nvim.appdata.xml 2026-04-14 12:57:17 -04:00
Justin M. Keyes
90c07e562c build(clang-analyzer): UB pointer subtraction
Problem:
clang-analyzer-security.PointerSub reports "Subtraction of two pointers
that do not point into the same array is undefined behavior" in the
HIKEY2SFT macro. Computing the offset of a flexible array member by
subtracting pointers from a dummy static object, is technically UB.

Solution:
Use standard `offsetof()` instead.

Co-Authored-By: Claude
2026-04-14 18:39:38 +02:00
Justin M. Keyes
e6aee903db build(clang-analyzer): suppress clang-analyzer-core.FixedAddressDereference
Problem: clang 21 added core.FixedAddressDereference, which reports
"dereference of a fixed address (loaded from variable 'r')" in regexp.c
after xmalloc(). The analyzer doesn't model xmalloc as always returning
a valid heap pointer (it aborts on failure), so it constructs impossible
paths.

Solution: Suppress globally in the clang-analyzer cmake target.

Co-Authored-By: Claude
2026-04-14 18:39:38 +02:00
Justin M. Keyes
eeee61ec9e build(clang-analyzer): suppress clang-analyzer-security.ArrayBound
Problem:
clang 21 promoted alpha.security.ArrayBoundV2 to security.ArrayBound
(stable). This new check reports false-positive "out of bound access"
errors in drawline.c and vimscript.c, where the analyzer constructs
impossible paths (e.g. concealed line with draw_text=false yet ptr
advanced past the NUL terminator, or root AST node with a "next"
sibling).

Per-line NOLINT suppression doesn't work because the analyzer finds
multiple paths to the same false positive.

Solution:
Disable clang-analyzer-security.ArrayBound globally in the
clang-analyzer cmake target until the check matures.

Co-Authored-By: Claude
2026-04-14 18:39:38 +02:00
dundargoc
8a4bee3ed0 build: update clang v21, fix warnings
- `src/nvim/ex_cmds_defs.h`: use "U" instead of "u" per
  `readability-uppercase-literal-suffix`
2026-04-14 18:39:38 +02:00
tao
e243bed18f docs: Windows nightly installation script #39053
Problem:
On Windows, when installing nightly build via winget, often
encounter "Installer hash does not match".

Solution:
use `Invoke-WebRequest` to download the msi package, then install
it via `msiexec`.
2026-04-14 12:22:03 -04:00
Justin M. Keyes
b3e7fe6647 Merge pull request #38688 from eamonburns/master
fix(build.zig): remove runtime dependency on Windows SDK
2026-04-14 12:20:49 -04:00
Olivia Kinnear
87c3d519aa feat(build): rename io.neovim.nvim to org.neovim.nvim 2026-04-14 11:13:03 -05:00
Olivia Kinnear
5181b8952c fix(build): fix make appimage 2026-04-14 11:09:19 -05:00
Justin M. Keyes
faad7c73ac test: n.rmdir() save-and-restore CWD #39048 2026-04-14 15:37:06 +00:00
zeertzjq
c0f33c9a86 vim-patch:6836599: runtime(zip): Detect path traversal issues on Windows (#39051)
6836599733

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-04-14 22:01:34 +08:00