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`.
Problem: using `vim.fs.rm(dir_path, { force = true, recursive = true })`
can result in an error on Windows if the process has a handle to it.
Solution: Use `n.rmdir()` helper in cases when its possible side effects
(like changing working directory) does not matter.
Problem: Attempting to emit cmdline_block event with NULL cmdbuff after
<C-\><C-N> in Ex-mode.
Solution: Don't emit cmdline_block event when cmdbuff is NULL.
Problem:
- Not obvious which _meta/ are generated and which should be edited
manually.
- The require guard (`error('Cannot require a meta file')`) is not
consistently present in all meta files.
Solution:
- Update headers.
- Add require() guard to all meta files.
- Rename generated meta files with `.gen.lua`.
Problem:
- Lots of redundant text in options docs for "not allowed in
a modeline", even though we already have a flag that indicates that.
- `deny_in_modelines` is an old vestigial flag only used by 'encoding'
(which never changes).
Solution:
- Generate docs based on the `secure` flag.
- Remove the `deny_in_modelines` flag (`kOptFlagNoML`).
Problem: compl_preselect_match is set even when completeopt doesn't
include preselect.
Solution: Check kOptCotFlagPreselect in ins_compl_add before setting
compl_preselect_match.
Problem: nfa_regmatch() allocates and frees two list buffers on every
call, causing unnecessary memory allocation overhead for
frequently used patterns.
Solution: Cache the list buffers in the regprog struct and reuse them
on subsequent top-level calls. Recursive calls still allocate
their own buffers. Free cached buffers in nfa_regfree()
(Yasuhiro Matsumoto).
Benchmark: 10K lines, `:%s` x50 iterations
| Pattern | Before | After | Improvement |
|---|---|---|---|
| `\<\(\w\+\%(ing\|tion\|ed\|ly\)\|\w\{3,}\)\>` (many matches) | 4.384s | 4.299s | -2% |
| `\(foo\|bar\|baz\)\{3,}\(qux\|quux\|corge\)\{2,}...` (no match, high nstate) | 16.927s | 3.015s | -82% |
closes: vim/vim#19956https://github.com/vim/vim/commit/105d65e29b636981b2a92cd0205b19f85951d770
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Problem:
The retry on Windows doesn't seem to actually work, as the test still
occasionally fails on Windows. Meanwhile the test can fail on Linux as
well:
FAILED test/functional/terminal/channel_spec.lua @ 123: chansend sends lines to terminal channel in proper order
test/functional/terminal/channel_spec.lua:131: retry() attempts: 1
test/functional/terminal/channel_spec.lua:134: Failed to match any screen lines.
Expected (anywhere): "echo "hello".*echo "world""
Actual:
|^ech$ o "hello" |
|echo "world" |
|hello |
|$ world |
|$ |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|term://~/work/neovim/neovim/build/Xtest_xdg_terminal//32516:sh [-] |
| |
Solution:
Use a wait before the chansend() instead.
Problem:
Neovim's Node.js provider does not support the Bun package manager.
PR #26829 attempted to add this but used a hardcoded path and was abandoned.
Solution:
- Use `bun pm bin -g` to dynamically locate the global binary directory.
- Update `health.lua` to recognize bun installations.
Problem: vim.lsp.util.show_document insert mode is unable
to set the cursor after the target character position if the target character
is at end of line.
Solution: Move cursor after the target character (in append position)
in this case.
Problem: win_linetabsize() includes wrap overhead from 'linebreak'
based on current window width, but the result sizes the window,
causing a feedback loop.
Solution: Temporarily set w_view_width to Columns before measuring.
Problem: _get_and_set_name edits the name for the whole group,
thus only one client per group gets the didOpen message.
Solution: move the logic to _changetracking and loop over every
client per group.
Problem:
Due to optimizations c936ae0f36, nvim prints literal spaces instead of using
`erase_chars` in widths <= 5 even if the terminal advertises `erase_chars`
support (perhaps a small-output size heuristic). However, this is not
semantically neutral: in some terminals, erased cells and printed spaces are
copied differently.
I ended up with two useful groups of results.
First, I tested raw terminal behavior without nvim involved:
| Terminal | Raw plain text | Raw `erase_chars` | Raw literal spaces |
| --- | --- | --- | --- |
| xterm | clean | trailing spaces copied | trailing spaces copied |
| xfce4-terminal | clean | clean | trailing spaces copied |
Second, I tested nvim itself:
| Terminal | no patch | with this patch |
| --- | --- | --- |
| xfce4-terminal | trailing spaces reproduced | clean |
| xterm | trailing spaces reproduced | trailing spaces reproduced |
| Alacritty | clean | clean |
| Ghostty | clean | clean |
| WezTerm | clean | clean |
Nvim often prints spaces instead of sending `erase_chars`, which this patch
changes for short clears when the terminal advertises it. This fixes
xfce4-terminal because raw `erase_chars` are already cleaned up by the terminal,
while spaces aren't. ***Notably, xterm is different***: even when `erase_chars`
is sent directly (NO NVIM INVOLVED) xterm *still* copies those cleared blank
trailing cells (and this is documented). So for xterm, which is the only
remaining problematic fix, I'm quite sure there's nothing we ought to do on the
Nvim side.
Solution:
Drop the `width >= 5` condition.
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'`.
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.
Problem:
Neovim currently fails to build on GNU Hurd. Because Hurd relies on
glibc, `<sys/param.h>` defines the `BSD` macro for 4.4BSD compatibility.
The preprocessor incorrectly routes Hurd into the BSD code paths, which
fatally fail during compilation because Hurd lacks `<sys/sysctl.h>` and
the `sysctl()` function.
Solution:
Update the preprocessor guards in `os/proc.c` to explicitly exclude
`__gnu_hurd__` from the BSD-specific `sysctl` blocks. Instead, group GNU
Hurd with the `__linux__` paths, as both systems rely on standard POSIX
interfaces and `/proc` parsing (which Hurd fully supports via its
`procfs` translator).
Testing:
The test suite does not fully pass yet natively on GNU Hurd
(specifically tests involving PTY closures and SIGHUP/SIGTERM trapping,
like `autocmd TermClose kills PTY job`). This is due to underlying
differences in Hurd's Mach RPC architecture and the `term` translator.
This patch does not attempt to fix those test executions, but simply
unblocks the core compiler as a necessary first step.
Problem:
The ui compositor does not use grid_scroll events when a grid other than
the built in msg_grid exists above the scrolled grid, regardless of
whether it actually intersects the scrolled grid anywhere in the
scrolled region.
When another layer exists at a higher zindex, the ui compositor falls
back to composing every line of the scrolled grid. This is especially
evident when using ui2 which creates a floating window that replaces the
built-in msg_grid. Scrolling around with ui2 enabled has poor
performance because the entire grid is recomposed on every scroll
instead of using grid_scroll.
Solution:
Instead of just checking whether another grid exists at a higher zindex
than curgrid, ensure there's a grid above the curgrid that is positioned
over the particular rectangle of interest, which could be a subrectangle
of the whole grid.
Grids above the curgrid that don't intersect there no longer count as
covering the curgrid, and the compositor can continue to use grid_scroll
scroll events. The floating window created for the command line/messages
with ui2 never intersects with the scrolled region of the main window
grid, which allows performant scrolling with it enabled.
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.
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.
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
Problem: Breaking a link with update=true loses colors inherited from
the linked group.
Solution: Copy color indices from the linked group so inherited colors
remain visible in :hi output.
vim-patch:9.2.0313: Callback channel not registered in GUI
vim-patch:9.2.0319: popup: rendering issues with partially transparent popups
vim-patch:9.2.0322: tests: test_popupwin fails
vim-patch:3e194b106 runtime(vimball): detect more path traversal attacks
vim-patch:9.2.0335: json_encode() uses recursive algorithm
vim-patch:9.2.0309: Missing out-of-memory check to may_get_cmd_block()
vim-patch:9.2.0310: unnecessary work in vim_strchr() and find_term_bykeys()
vim-patch:8.2.2824: MS-Windows: build failure with MSVC
vim-patch:9.1.1692: global_functions are not constant
Problem: Missing help for a function goes unnoticed.
Solution: Add a test. (Gary Johnson)
https://github.com/vim/vim/commit/6b0e528368415476bfc3a8414c9c70f9852b1517
----
Test relies on parsing runtime/doc/*.txt and src/evalfunc.c .
Error-prone because Vim and Nvim diverged on both documentation
and source code in spite of ported Vim patches.
Importing src/nvim/eval.lua is an alternative
but it uses associatve index such that it's unsorted.
Treat it as N/A because I can't rewrite any of its tests
under minimal effort.
----
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: spell_read_aff() uses sprintf() into a fixed-size stack buffer
without bounds checking. store_aff_word() uses STRCAT() to
append attacker-controlled strings into newword[MAXWLEN] without
checking remaining space. Both are reachable via :mkspell with
crafted .aff/.dic files (xinyi234)
Solution: Replace sprintf() with vim_snprintf() in spell_read_aff().
Replace STRCAT() with STRNCAT() with explicit remaining-space
calculation in store_aff_word().
closes: vim/vim#19944https://github.com/vim/vim/commit/07faa961a05bc5ea007ab70ff483ea1b32c3371d
Co-authored-by: Christian Brabandt <cb@256bit.org>