Commit Graph

37929 Commits

Author SHA1 Message Date
zeertzjq
8bbcd3e00e vim-patch:9.2.1024: 'wildmode' list:full does not complete first match
Problem:  With 'wildmode' set to list:full, matches are listed but the
          first match is not completed on the first Tab press (rendcrx).
Solution: Do not suppress selection when list and full are active in
          the same completion phase.  Add regression tests for file
          completion, comma-separated phases and noselect precedence
          (Seunghee Kim).

fixes:   vim/vim#19532
related: vim/vim#18088
closes:  vim/vim#21181

54c988c6c5

Co-authored-by: SeungheeKim <ksh368@naver.com>
2026-09-02 09:51:47 +08:00
zeertzjq
b279472393 vim-patch:9.2.0468: popups: not correctly updated from a CmdlineChanged autocommand
Problem:  popup_show() from a CmdlineChanged autocommand doesn't update
          the screen (Mao-Yining)
Solution: Refresh the screen when popups need redraw
          (Yasuhiro Matsumoto).

popup_settext()/popup_show() called from a CmdlineChanged autocommand
did not refresh the screen because cmdline mode normally skips
update_screen(), so async info-popup updates only became visible after
a manual :redraw.  Refresh the screen when popups need redrawing right
after the autocommand.

fixes:  vim/vim#20175
closes: vim/vim#20179

ef1ecc3b61

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-09-02 09:51:41 +08:00
Justin M. Keyes
9a29622b54 feat(multicursor): MC HAMMER #41587
Other (squashed) commits:

fix(tui): emit ui_send output atomically with the frame

Problem:
tui_ui_send() writes directly to the TTY, bypassing the output buffer.
Sequences sent via nvim_ui_send() (e.g. kitty multiple-cursors, or
visual-dot-repeat) always arrive in a separate TTY write from the frame
they were computed for. This manifests as "tearing", or e.g. in the case
of multicursor the terminal renders text with stale cursor overlays.

Solution:
- tui_ui_send(): while a frame is being assembled (pending invalid
  regions or buffered output), buffer instead of writing directly.
  - Out-of-frame sends (tty queries, clear-on-disable) still write
    immediately.
- mcursor.lua: emit the terminal-cursor update at the end of the redraw
  cycle (`on_end`, when screen positions are final) instead of
  vim.schedule().
2026-09-01 15:17:22 +00:00
Evgeni Chasnovski
9ebf9b1017 fix(ui2): respect options set during startup after enabling ui2 #41591
Problem: options related to ui2 (like `fillchars` with `msgsep`) do not
  take effect if set during startup after enabling ui2.

Solution: explicitly check just after startup if relevant options were
  changed during startup.
2026-09-01 13:23:23 +00:00
Jaehwang Jung
ca992e82d4 fix(buffer): keep trailing slash significant in URI names #41577
Problem:
Literal path comparison ignored one trailing slash for every buffer name,
including URIs. Generic URI syntax does not make a non-empty path
equivalent to the same path with a trailing slash, so distinct URI
buffers collapsed into one.

Solution:
Require equal lengths when comparing URI buffer names, while retaining
trailing-separator normalization for filesystem paths.

AI-assisted
2026-09-01 01:04:57 +00:00
Justin M. Keyes
9d2a31b05e fix(cwd): flicker after temp context-switch #41561 #41582
Problem:
`shorten_fnames()` always redraws the statusline/tabline, even if no
buffer name changed. Since b296666e a temp context-switch
(`win_execute()`, `vim._with{win=}`) restores the CWD, so every such
switch flickers the message area.

Solution:
Redraw only if `shorten_buf_fname()` actually changed a name.
2026-08-31 20:49:50 -04:00
dependabot[bot]
16a1d203e9 ci: bump the github-actions group across 1 directory with 2 updates
Bumps the github-actions group with 2 updates in the / directory: [github/codeql-action](https://github.com/github/codeql-action) and [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm).


Updates `github/codeql-action` from 4.37.6 to 4.37.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.37.6...v4.37.8)

Updates `vmactions/freebsd-vm` from 1.5.3 to 1.5.4
- [Release notes](https://github.com/vmactions/freebsd-vm/releases)
- [Commits](83b151f58c...d0518f9125)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.37.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: vmactions/freebsd-vm
  dependency-version: 1.5.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-31 14:48:10 +02:00
wrvsrx
c275b5de5a fix(lsp): separate adjacent nested folding ranges #41428
Problem:
Folding range markers are overwritten while ranges are evaluated. A range ending on a row can hide another range starting there, and multiple nested ranges ending together emit only the innermost ending level.

Solution:
Track starts and the number of ends per row before emitting markers. Prefer starts on shared boundary rows and use the outermost level when nested ranges end together.

AI-assisted
2026-08-31 08:41:19 -04:00
Christian Clason
e084aa6bde build(deps): bump libiconv to v1.19 2026-08-31 14:28:05 +02:00
Aryan Pandey
ad42ee1c41 fix(cmdwin): handle UTF-8 characters containing 0x80 #41566
Problem:
Confirming cmdwin with a UTF-8 character containing 0x80 does not complete the
command.

Solution:
Escape K_SPECIAL bytes while feeding the cmdwin input after confirmation.
2026-08-31 06:52:20 -04:00
github-actions[bot]
2b6a09c2f1 docs: update version.c #41506
vim-patch:8.2.0992: Vim9: crash when using :import in the Vim command
vim-patch:8.2.2872: Python tests fail without the channel feature
vim-patch:8.2.3589: failure when "term_rows" of term_start() is an unusual value
vim-patch:8.2.3597: Vim seems to hang when writing a long text to a terminal
vim-patch:8.2.3761: focus change is not passed on to a terminal window
vim-patch:8.2.4157: terminal test fails because Windows sets the title
vim-patch:8.2.4535: filename modifer ":8" removes the filename
vim-patch:8.2.4758: when using an LSP channel want to get the message ID
vim-patch:0646047b6 runtime(doc): clarify term_start() I/O behavior for Unix pty and MS-Windows ConPTY
vim-patch:9.2.0412: channel: term_start() out_cb/err_cb no longer deliver raw chunks
vim-patch:9.2.0420: channel: cannot handle binary data via channel callbacks
vim-patch:9.2.0565: [security]: out-of-bounds read in update_snapshot()
vim-patch:ba43008a2 runtime(doc): Update vim9.txt revisions, standardizing SS1,3-7
vim-patch:9.2.1013: [security]: out-of-bounds access in libvterm CSI 8 t resize
vim-patch:9.2.1021: GTK: Cursor blinks irregularly
vim-patch:4b2d42c43 CI: Bump github/codeql-action
vim-patch:9.2.1022: popup: width changes while scrolling
vim-patch:9.2.1023: GvimExt: destructors of polymorphic classes are not virtual

vim-patch:8.2.3979: Vim9: the feature is not mentioned in the right places
vim-patch:9.0.0058: Win32: cannot test low level events
vim-patch:9.0.1604: errors from the codestyle test are a bit confusing

vim-patch:3052bdb: runtime(doc): update the default value for 'isk' on Windows
2026-08-31 05:26:06 -04:00
zeertzjq
57d97e513d Merge pull request #41568 from zeertzjq/vim-560dfad
vim-patch: runtime file updates
2026-08-31 11:12:49 +08:00
zeertzjq
8edcb401cf vim-patch:5c9c5a4: runtime(c): syntax depends on the 'iskeyword' option
Problem:  C keywords are matched using the characters from 'iskeyword',
          so changing that option highlights part of an identifier as a
          keyword and leaves keywords containing an underscore
          unhighlighted.
Solution: Set the keyword characters with ":syn iskeyword".

fixes:  vim/vim#21173
closes: vim/vim#21176

5c9c5a43c1

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-Authored-By: Maxim Kim <habamax@gmail.com>
2026-08-31 10:46:52 +08:00
zeertzjq
a61bd270d6 vim-patch:41cab67: runtime(gitignore): take care when undo_ftplugin is already set
closes: vim/vim#21180

41cab67eef

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
2026-08-31 10:46:15 +08:00
zeertzjq
7f7115f752 vim-patch:560dfad: runtime(yaml): syntax highlighting of numbers is slow
Problem:  YAML syntax highlighting is slow; the yamlInteger and yamlFloat
          rules alone account for over half of the parsing time.
Solution: The number, null and timestamp scalar patterns begin with a
          lookbehind, which stops the regexp engine from using a
          first-character search, so the automatic engine selects the
          much slower NFA engine.  Force the backtracking engine with
          \%#=1 on these patterns for a large speedup with identical
          matches (Jordan).

On a 40000-line YAML file the total :syntime drops by about 30%: the
yamlFloat rule goes from 0.61s to 0.17s and yamlInteger from 0.42s to 0.31s.
The engine override is applied only to the lookbehind-anchored number rules;
forcing it on the structural plain-scalar and mapping-key patterns regresses
them badly, so those are left on the automatic engine.

closes: vim/vim#21182

560dfadac8

Co-authored-by: Julien Voisin <julien.voisin@dustri.org>
2026-08-31 10:45:59 +08:00
Justin M. Keyes
b542f3a8f8 fix(cmdatom): edit-repeat mapping #41564
Problem:
The "." example mapping at `:h edit-repeat` doesn't work well with
`nvim_feedkeys(…, 'mt', false)`.

Solution:
Use `vim.b[ev.buf].maxseq` instead of `undotree()`.
2026-08-30 23:38:34 +00:00
Justin M. Keyes
95da81ef15 Merge #41560 from justinmk/cmdatom 2026-08-30 18:43:32 -04:00
not_compiled
7dc0592fca fix(ui2): cursor flicker in cmdline with matchit #41245
Problem:
The cmdline_hide callback causes an unnecessary cursor move to the cmdline,
before the normal redraw updates the cursor back to the current window. This
appears as "flicker" when using plugins such as matchit (legacy ":" mappings
instead of "<cmd>" mappings).

Solution:
Skip the immediate redraw for cmdline_hide events. The normal redraw
still updates the cursor after the cmdline window is hidden.
2026-08-30 18:33:59 -04:00
Justin M. Keyes
25f7c87a70 fix(mappings): replaying a deleted Lua mapping is UB
Problem:
Replaying a deleted Lua mapping, may call an arbitrary function.

RHS of a Lua mapping embeds its LuaRef (`<K_LUA><ref><CR>`). The raw
keys may outlive the ref (redobuff ".", CmdAtom `keys`). If the mapping
is deleted, replaying it either (1) dereferences a freed registry slot,
or (2) calls whatever callback reused the slot (autocmd, timer, other
mapping).

Solution:
Assign a monotonic (never recycled) id to Lua mappings and encode the
mapping keys as `<K_LUA><id><CR>`.

Note: in the case of Vimscript, a deleted function raises E117, but if
the function is redefined with the same name, the mapping will find it.

Alternatives?:
- Globally ensure `LuaRef` ids are not recycled.
  - Problem: could exhaust `int` in a long-lived Nvim session? Also,
    difficult to impl bc the "recycling" is done by `luaL_ref` itself.

ref: 5ac2e47acc
2026-08-31 00:16:01 +02:00
Justin M. Keyes
bc16be3cd9 fix(cmdatom): operator with Lua textobject is not type=operator
Problem:
An operator completed by a Lua `:omap` textobject emits
`CmdAtom.type="mapping"` (lhs-only, no keys) instead of `type="operator"`.

Analysis:
`atom_redo_set()` declined K_LUA, though the prepped redo
("op" + K_LUA + id + CR) is exactly what "." replays. A no-edit "g@"
emits nothing at all.

Solution:
- `atom_redo_set`: don't decline K_LUA; the redo route now captures the
  operator atom.
- `atom_capture_cmd`: don't early-return if the frame has prepped redo.
- op_function(): save/restore redobuff when invoking 'operatorfunc',
  like `call_user_func()` does for Vimscript. (Else the Lua callback
  may clobber the prepped "g@" redo / dot-repeat.)

fix #41482

TODO:
- async Lua (timer/vim.schedule) can still clobber the pending dot-repeat...
2026-08-31 00:16:01 +02:00
Christian Clason
de83b54ddf build(deps): bump wasmtime to v48.0.1 2026-08-30 19:47:07 +02:00
Christian Clason
09a77231e5 build(deps): bump tree-sitter to v0.27.0 2026-08-30 19:47:07 +02:00
Justin M. Keyes
97cf2041c1 Merge #41550 from janlazo/na-patch-channel
build(vim-patch): n/a channel,terminal,test,unicode patches
2026-08-30 08:45:06 -04:00
Nathan Zeng
39862231b2 fix(snippet): cancel session on ESC in insert-mode #41555
Problem:
If a snippet does not have a placeholder, we use insert mode instead of
select mode. From here <Esc> leaves the session and highlight active.

Solution:
Cancel the session on <Esc>.
2026-08-30 08:32:55 -04:00
Christian Clason
5e0b1464b2 docs(cmake): remove misleading comment
We still require this file since the upstream version can't find the
glibc version on Linux.
2026-08-30 14:13:03 +02:00
Christian Clason
06ee65415e build(deps): bump libiconv to v1.18 2026-08-30 14:13:03 +02:00
Justin M. Keyes
eb18f29748 test(tui): unreliable "exits immediately when stdin is closed" #41547
Problem:
0c091cedc2 fixed the "immediate exit" but the 2s `nvim_get_proc()`
check still fails on slow (ASAN) CI.

Solution:
Check the pid after the `screen:expect`. Anyway, `assert_nolog` is the
"meaningful" part of the test since 0c091cedc2.
2026-08-30 07:13:02 -04:00
Christian Clason
87474c88aa build(deps): use upstream server for gettext, libiconv
Problem: `gettext` and `libiconv` are hosted on a single FTP server
which can be flaky. Since this impacts CI, we mirror them at
neovim/deps, but that creates maintainer friction.

Solution: Since the Zig build is tied to the upstream server anyway (via
allyourcodebase/libiconv) and most other platforms do not build the
bundled versions, just use the upstream server for CMake as well.
2026-08-30 10:57:11 +02:00
Christian Clason
6c96ec8c45 build(deps): vendor lpeg
Problem: LPeg is hosted on a single unreliable external hoster, forcing
is to mirror it in neovim/deps, which adds maintenance friction. Also,
we have already vendored the Lua `re.lua` module.

Solution: Vendor all of LPeg v1.1.0; as development is not very active
anymore, this should not add much overhead (and allow us to simplify in
particular the Zig build scripts).

Note: LPeg defines a `luaL_newlib` macro for Lua 5.1, which conflicts
with LuaJIT's extension. This requires inlining the macro defined in
`lptypes.h` and used in `lptree.c`; see README.md for the patch.
2026-08-30 10:53:36 +02:00
Christian Clason
752f4b944b build(deps): bump unibilium to v2.1.4
Build system adaptations to upstream changes:

* added `build.zig`
* `CMakeLists.txt` with (opt-out) support for docs, tests, tools
  (disabled)
2026-08-30 09:43:19 +02:00
Christian Clason
84e429a0b2 build(zig): use system library for libiconv on macOS
Problem: Unlike CMake, `build.zig` downloads and builds GNU libiconv
on macOS instead of linking to the system framework.

Solution: Only pull in the libiconv dependency on Windows and link
against system framework on macOS.
2026-08-30 09:15:05 +02:00
Jan Edmund Lazo
97f06b936e build(vim-patch): v8.2.4535 is n/a
Nvim removed support for DOS 8.3 filename.
2026-08-29 20:26:12 -04:00
Jan Edmund Lazo
c47a2fbf7b build(vim-patch): v8.2.3597 is n/a
Nvim already has 'scrollback' option.
2026-08-29 19:37:59 -04:00
Jan Edmund Lazo
82ea5a8aac vim-patch:8.2.4439: accepting "iso8859" 'encoding' as "iso-8859-" (#41545)
Problem:    Accepting "iso8859" 'encoding' as "iso-8859-".
Solution:   use "iso8859" as "iso-8859-1".

1349bd712c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2026-08-30 07:06:07 +08:00
Jan Edmund Lazo
063c76f500 build(vim-patch): v8.2.3068 is almost auto n/a
Nvim uses utf8proc or an older process involving "src/unicode/"
and "download-unicode-files.sh" to decouple unicode characters
from "mbyte.c".
These unicode patches should be auto N/A but the diff hunk xfuncname
is wrong for utf_char2cells().
Is it because of the `#ifdef`?
Need a volunteer to inspect if these patches still have relevant
changes

Nvim

```c
/// same as utf_composinglike but operating on UCS-4 values
bool utf_iscomposing(int c1, int c2, GraphemeState *state)
{
  return (!utf8proc_grapheme_break_stateful(c1, c2, state)
          || arabic_combine(c1, c2));
}
```

Vim

```c
/*
 * Return TRUE if "c" is a composing UTF-8 character.  This means it will be
 * drawn on top of the preceding character.
 * Based on code from Markus Kuhn.
 */
    int
utf_iscomposing(int c)
{
    // Sorted list of non-overlapping intervals.
    // Generated by ../runtime/tools/unicode.vim.
    static struct interval combining[] =
    {
	{0x0300, 0x036f},
	{0x0483, 0x0489},
	{0x0591, 0x05bd},
        // ...
	{0x0300, 0x036f},
	{0x0483, 0x0489},
	{0x0591, 0x05bd},
    };

    return intable(combining, sizeof(combining), c);
}
```
2026-08-29 14:49:56 -04:00
Jan Edmund Lazo
ee19522048 build(vim-patch): v8.2.2872 is n/a 2026-08-29 14:49:56 -04:00
Jan Edmund Lazo
9e8f032f33 build(vim-patch): v9.2.0420 is n/a 2026-08-29 14:49:56 -04:00
Jan Edmund Lazo
985f834cc7 build(vim-patch): v8.2.4758 is n/a 2026-08-29 14:49:55 -04:00
not_compiled
fbc5a769aa fix(ui2): don't draw MsgSeparator if cmdheight=0 #41531
Problem:
When 'cmdheight' is 0, the MsgSeparator can obscure the statusline when
a message is displayed, making its contents disappear until
the next redraw.

Solution:
Skip the separator when 'cmdheight=0' available.
2026-08-29 11:22:37 -04:00
Yanze Li
ab707262b1 fix(lsp): blank line before Content-Length breaks header parsing #41524
Problem:
A blank line before the Content-Length header makes header parsing
fail with "Content-Length not found in header". An LF in the 'name'
state falls through to the 'invalid' state, which only return to
'name' at the *next* LF. That LF terminates the next line, so the
line with Content-Length is swallowed.
The same issue happens when a junk line is a partial match of the
header name (e.g. "Cont\nContent-Length: ...").

Solution:
When seeing an LF in the 'name' state, reset the cursor and stay in
'name' rather than entering 'invalid'.
2026-08-29 09:13:04 -04:00
Justin M. Keyes
cbb0775fb6 Merge #41529 from justinmk/cmdatom 2026-08-29 05:17:52 -04:00
zeertzjq
aea69c660b vim-patch:9.2.1019: completion asked for during 'autocompletedelay' looks automatic (#41535)
Problem:  A completion asked for with CTRL-X CTRL-O while
          'autocompletedelay' is running is given the look of an
          automatic one, the implicit "noselect" among it.
Solution: Turn autocompletion off where a typed key takes the completion
          over.  A completion already on screen goes on being what it
          was (Hirohito Higashi).

closes: vim/vim#21158

c8e432b266

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-08-29 08:50:00 +08:00
zeertzjq
5cd7b3a9ad vim-patch:9.2.1018: filetype: radvd config files are not recognized (#41534)
Problem:  filetype: radvd config files are not recognized
Solution: Detect radvd.conf as radvd filetype, include syntax and
          filetype plugins, add syntax tests, update the menus (mdspan).

Reference:
https://linux.die.net/man/5/radvd.conf

closes: vim/vim#21159

d4c8c66bed

Co-authored-by: mdspan <mdspan.github@gmail.com>
2026-08-29 08:49:18 +08:00
zeertzjq
5de6537c42 vim-patch:9.2.1017: heap-use-after-free in ml_open_file() (#41533)
Problem:  A SwapExists autocmd can re-open the buffer being edited,
          causing ml_close() to free the memfile that
          ml_open_file() still holds a local pointer to, causing
          use-after-free.
Solution: After findswapname() returns, verify that buf->b_ml.ml_mfp
          is still the same as the copy mfp we hold.

closes: vim/vim#21171

7aecb2cca8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-08-29 08:33:38 +08:00
Justin M. Keyes
bdbd99ab10 test(tui): unreliable "TUI :detach % detaches other UIs" 2026-08-29 01:06:29 +02:00
Justin M. Keyes
2514256d95 refactor(input): exec stuffed keys eagerly
Problem:
The Vim "stuff" concept breaks the ability to reason about the call
stack and thus the boundaries of a `CmdAtom`: a stuffed translation ("x"
=> "dl") defers to the main loop. This "continuation" must be modeled in
`CmdAtom`, by checking global flags at undefined times, during undefined
circumstances.

Solution:
- After a stuffed "translation", eagerly execute the stuff buffer
  (`exec_stuffed()`).
- Delete the CmdAtom "continuation" junk.

Note:
- op_colon runs its cmdline "nested", but that's fine because operators
  already nest interactive sessions there (op_change runs edit()), and
  the cmdline is frameless so the operator's frame can own/capture it.
2026-08-29 01:06:26 +02:00
Rob Pilling
61958f2335 fix(cmdwin): allow a user to switch to other buffers #41199 2026-08-28 13:34:31 -04:00
Justin M. Keyes
e28d725e46 refactor(scripts): drop download-unicode-files.sh #41528
Unused since 26be6446e5, which removed src/unicode/ in favor of
utf8proc.
2026-08-28 15:21:42 +00:00
Justin M. Keyes
aaab8cdac4 fix(gen_help_html): cleanup #41525 2026-08-28 10:24:40 -04:00
Rob Pilling
f5d4b5975d fix(tabpage): focusing a tab while closing it, fails assert #41475
Problem:
If an autocommand handler focuses the tab page we're closing during a
`:tabonly` (with some conditions), we hit an assert failure in
`win_close_othertab()`.

For this to occur, we need:
- `nvim_buf_delete()` to trigger `close_windows()` (as is done in
	`cmdwin.lua`'s `_cleanup()`)
- `close_windows()` then calls `win_close_othertab()`, removing the
	window (`win_free_mem()`)
- then in the caller, `tabpage_close_other()`, the loop continues (we
	don't detect `tp_lastwin == wp` since we've unlinked the window)
- the loop assumes that `curtab != tp`

but we've refocused `curtab` so the `ex_win_close()` call passes `tp` as
`curtab`, causing the assert to fail

Solution:
Detect the focus of `curtab` and abort closing the tab.
2026-08-28 08:39:16 -04:00