Commit Graph

19458 Commits

Author SHA1 Message Date
Justin M. Keyes
d9d3822a7b docs: misc #38532
Close #38431
Close #38521
Close #38530

Co-authored-by: tayheau <thopsore@pasteur.fr>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Olivia Kinnear <git@superatomic.dev>
2026-03-29 11:56:37 -04:00
zeertzjq
79ebe54634 refactor(ui_client.c): remove unused variable (#38552)
It's been unused since #36319.
2026-03-29 11:24:52 +00:00
Justin M. Keyes
7cd22e916b fix(:connect): formalize connect event #38543
Also document it.
2026-03-29 06:59:34 -04:00
zeertzjq
44a88a746f fix(:restart): specify ++nested in UIEnter (#38550) 2026-03-29 09:04:15 +00:00
zeertzjq
ad4bc2d90c refactor(:restart): execute [command] on UIEnter (#38541)
This avoids having to pass it in the UI event.
2026-03-29 08:12:32 +08:00
Justin M. Keyes
bff9b5f010 refactor: move ugrid.c => tui/ugrid.c #38540
This module is only used by the tui code.
2026-03-28 20:05:53 -04:00
Sathya Pramodh
d5516daf12 fix(:restart): formalize restart event #35223
Problem:
The "restart" event has some problems:
- all UI clients must implement a somewhat complex set of setups
- UI must be on the same machine as the server
- only works for the "current" UI
- race/edge case: If the user config has errors / waiting for input, are
  all UIs able to attach while Nvim is waiting for input?

Solution:
- Perform the restart on the server, not the client.
- Pass listen address (instead of CLI args) in the UI event.
- Simplifies UI logic: they only need to attach to new address.
- Opens the door for more enhancements in the future, such as allowing
  all UIs to reattach instead of only the "current" UI.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-28 15:25:09 -04:00
Justin M. Keyes
64d55b74d8 docs: news #38464 2026-03-28 09:59:54 -04:00
Shadman
7bf83cc2a6 fix(progress): require "source" for progress-message #38514
Problem:
- Progress-events are filtered by "source". But "source" is not required by nvim_echo.
- Without "++nested" (force=false), nvim_echo in an event-handler does not trigger Progress events.
- vim.health does not declare a "source".

Solution:
- Make source mandatory for progress-messages
- Enable ++nested (force=true) by default when firing Progress event.
- Set "source" in vim.health module.
2026-03-28 09:22:22 -04:00
zeertzjq
5a7df03b42 vim-patch:9.2.0265: unnecessary restrictions for defining dictionary function names (#38524)
Problem:  unnecessary restrictions for defining dictionary function
          names
Solution: Allow defining dict function with bracket key that is not a
          valid identifier (thinca)

In Vim script, "function obj.func()" and "function obj['func']()" both
define a dictionary function.  However, the bracket form required the
key to match function naming rules (eval_isnamec), so
"function obj['foo-bar']()" failed with E475.

Assigning and calling already work: "let obj['foo-bar'] = obj.func"
and "call obj['foo-bar']()" are valid.  Only the definition was
incorrectly restricted.

Skip the identifier check when the name comes from fd_newkey (i.e. the
key was given in bracket notation).  Dictionary keys may be any string.

Supported by AI

closes: vim/vim#19833

f89662722d

Co-authored-by: thinca <thinca@gmail.com>
2026-03-28 18:51:00 +08:00
glepnir
9383a096eb fix(api): nvim_set_hl boolean false corrupts underline styles (#38504)
Problem: setting one underline style to false clears bits belonging
to another style. `{underdouble = true, underdashed = false}` results
in undercurl because CHECK_FLAG_WITH_KEY does `m &= ~flag` which
doesn't work for multi-bit encoded values sharing HL_UNDERLINE_MASK.

Solution: use a local variable to derive the correct clear mask from
the flag. Clear the whole HL_UNDERLINE_MASK field instead of individual
bits, and only clear on false when the current style actually matches.
2026-03-28 15:26:46 +08:00
zeertzjq
9287c73df9 fix(:connect): don't use freed memory (#38512)
Changing REUSE_MAX from 4 to 0 produces the following ASAN error:

=================================================================
==924403==ERROR: AddressSanitizer: heap-use-after-free on address 0x7d33333ed128 at pc 0x55f165a47a86 bp 0x7fff40e71690 sp 0x7fff40e71688
READ of size 1 at 0x7d33333ed128 thread T0
    #0 0x55f165a47a85 in socket_address_tcp_host_end **/src/nvim/event/socket.c:37:30
    #1 0x55f1667d6349 in channel_connect_event **/src/nvim/ui_client.c:296:17
    #2 0x55f165a35af6 in multiqueue_process_events **/src/nvim/event/multiqueue.c:159:7
    #3 0x55f165a308f6 in loop_poll_events **/src/nvim/event/loop.c:81:3
    #4 0x55f1667d3fbc in ui_client_run **/src/nvim/ui_client.c:172:5
    #5 0x55f165e1f2e1 in main **/src/nvim/main.c:367:5
    #6 0x7f23340bc6c0 in __libc_start_call_main /usr/src/debug/glibc/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:59:16
    #7 0x7f23340bc7f8 in __libc_start_main /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:360:3
    #8 0x55f16521d044 in _start (**/build/bin/nvim+0xcb9044) (BuildId: 6c8517919bbcd317c6bb5675d1eb3f2c7c319e2c)

0x7d33333ed128 is located 40 bytes inside of 4096-byte region [0x7d33333ed100,0x7d33333ee100)
freed by thread T0 here:
    #0 0x55f16532547d in free.part.0 asan_malloc_linux.cpp.o
    #1 0x55f165fc2380 in xfree **/src/nvim/memory.c:159:3
    #2 0x55f165fc5b6d in free_block **/src/nvim/memory.c:786:5
    #3 0x55f165fc5c38 in arena_mem_free **/src/nvim/memory.c:798:5
    #4 0x55f166082dd2 in parse_msgpack **/src/nvim/msgpack_rpc/channel.c:258:7
    #5 0x55f166078ade in receive_msgpack **/src/nvim/msgpack_rpc/channel.c:217:5
    #6 0x55f165a4683b in read_event **/src/nvim/event/rstream.c:234:23
    #7 0x55f165a462d8 in invoke_read_cb **/src/nvim/event/rstream.c:287:3
    #8 0x55f165a42e11 in read_cb **/src/nvim/event/rstream.c:149:3
    #9 0x55f166bdc28b in uv__read **/.deps/build/src/libuv/src/unix/stream.c:1145:7
    #10 0x55f166bdba97 in uv__stream_io **/.deps/build/src/libuv/src/unix/stream.c:1208:5
    #11 0x55f166bca7fe in uv__io_cb **/.deps/build/src/libuv/src/unix/core.c:930:5
    #12 0x55f166be6251 in uv__io_poll **/.deps/build/src/libuv/src/unix/linux.c:1546:11
    #13 0x55f166bc9c57 in uv_run **/.deps/build/src/libuv/src/unix/core.c:460:5
    #14 0x55f165a30be7 in loop_uv_run **/src/nvim/event/loop.c:59:3
    #15 0x55f165a30864 in loop_poll_events **/src/nvim/event/loop.c:80:26
    #16 0x55f1667d3fbc in ui_client_run **/src/nvim/ui_client.c:172:5
    #17 0x55f165e1f2e1 in main **/src/nvim/main.c:367:5
    #18 0x7f23340bc6c0 in __libc_start_call_main /usr/src/debug/glibc/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:59:16
    #19 0x7f23340bc7f8 in __libc_start_main /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:360:3
    #20 0x55f16521d044 in _start (**/build/bin/nvim+0xcb9044) (BuildId: 6c8517919bbcd317c6bb5675d1eb3f2c7c319e2c)

previously allocated by thread T0 here:
    #0 0x55f1653263e5 in malloc (**/build/bin/nvim+0xdc23e5) (BuildId: 6c8517919bbcd317c6bb5675d1eb3f2c7c319e2c)
    #1 0x55f165fc2054 in try_malloc **/src/nvim/memory.c:113:15
    #2 0x55f165fc22b4 in xmalloc **/src/nvim/memory.c:147:15
    #3 0x55f165fc4d5d in alloc_block **/src/nvim/memory.c:717:12
    #4 0x55f165fc4e09 in arena_alloc_block **/src/nvim/memory.c:724:20
    #5 0x55f165fc5113 in arena_alloc **/src/nvim/memory.c:746:5
    #6 0x55f166096d98 in api_parse_enter **/src/nvim/msgpack_rpc/unpacker.c:161:5
    #7 0x55f166aa290e in mpack_parse_tok **/src/mpack/object.c:56:29
    #8 0x55f166aa4fa9 in mpack_parse **/src/mpack/object.c:82:16
    #9 0x55f166099de9 in unpacker_advance **/src/nvim/msgpack_rpc/unpacker.c:343:12
    #10 0x55f1660825c9 in parse_msgpack **/src/nvim/msgpack_rpc/channel.c:248:10
    #11 0x55f166078ade in receive_msgpack **/src/nvim/msgpack_rpc/channel.c:217:5
    #12 0x55f165a4683b in read_event **/src/nvim/event/rstream.c:234:23
    #13 0x55f165a462d8 in invoke_read_cb **/src/nvim/event/rstream.c:287:3
    #14 0x55f165a42e11 in read_cb **/src/nvim/event/rstream.c:149:3
    #15 0x55f166bdc28b in uv__read **/.deps/build/src/libuv/src/unix/stream.c:1145:7
    #16 0x55f166bdba97 in uv__stream_io **/.deps/build/src/libuv/src/unix/stream.c:1208:5
    #17 0x55f166bca7fe in uv__io_cb **/.deps/build/src/libuv/src/unix/core.c:930:5
    #18 0x55f166be6251 in uv__io_poll **/.deps/build/src/libuv/src/unix/linux.c:1546:11
    #19 0x55f166bc9c57 in uv_run **/.deps/build/src/libuv/src/unix/core.c:460:5
    #20 0x55f165a30be7 in loop_uv_run **/src/nvim/event/loop.c:59:3
    #21 0x55f165a30864 in loop_poll_events **/src/nvim/event/loop.c:80:26
    #22 0x55f1667d3fbc in ui_client_run **/src/nvim/ui_client.c:172:5
    #23 0x55f165e1f2e1 in main **/src/nvim/main.c:367:5
    #24 0x7f23340bc6c0 in __libc_start_call_main /usr/src/debug/glibc/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:59:16
    #25 0x7f23340bc7f8 in __libc_start_main /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:360:3
    #26 0x55f16521d044 in _start (**/build/bin/nvim+0xcb9044) (BuildId: 6c8517919bbcd317c6bb5675d1eb3f2c7c319e2c)

SUMMARY: AddressSanitizer: heap-use-after-free **/src/nvim/event/socket.c:37:30 in socket_address_tcp_host_end
Shadow bytes around the buggy address:
  0x7d33333ece80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7d33333ecf00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7d33333ecf80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7d33333ed000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x7d33333ed080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x7d33333ed100: fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd
  0x7d33333ed180: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x7d33333ed200: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x7d33333ed280: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x7d33333ed300: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x7d33333ed380: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==924403==ABORTING
2026-03-27 22:32:06 +08:00
Shadman
a940b77cb2 feat(prompt): prompt_appendbuf() appends to prompt buffer #37763
Problem:
Currently, we recommend always inserting text above prompt-line in
prompt-buffer. This can be done using the `:` mark. However, although
we recommend it this way it can sometimes get confusing how to do it
best.

Solution:
Provide an api to append text to prompt buffer. This is a common
use-case for things using prompt-buffer.
2026-03-27 07:39:09 -04:00
kq
3898f34c5a fix(messages): spurious newline with --headless + cmdheight=0 #38494
Problem:
When running nvim in headless mode with `cmdheight=0`, an extra newline
is prepended to output (eg. `nvim --clean --cmd 'set cmdheight=0'
--headless -c 'echo 1 | q' ` prints `\n1` instead of `1`), because
`!ui_has(kUIMessages)` is always true in headless mode, causing `p_ch ==
0` in `msg_start()` to unconditionally trigger `msg_putchar('\n')` which
writes a newline to stdout.

Solution:
When in headless printf mode with `p_ch == 0` and no prior output on the
current line, call `msg_puts_display("\n", ...)` directly instead of
`msg_putchar('\n')`, so the grid is still updated for correct screen
positioning but no newline is written to stdout.
2026-03-27 07:08:32 -04:00
Shadman
4b643d7068 feat(progress): set Progress-event pattern to "source" #38495
Problem:
Currently, there's no way to distinguish progress messages coming from
different sources. Nor can Progress event be easily filtered based on
source.

Solution:
- Add "source" field to nvim_echo-opts.
- The Progress event pattern is now defined by the "source" field.
- Include the "title" as ev.data.
- Unrelated change: set force=false to disable nesting.
2026-03-27 06:24:14 -04:00
github-actions[bot]
77f2a478c8 docs: update version.c #38455
vim-patch:9.2.0234: test: Test_close_handle() is flaky
vim-patch:a603175c6 runtime(manpager): use \x07 instead of \a for BEL in OSC 8 regex
vim-patch:9.2.0245: xxd: color output detection is broken
vim-patch:9.2.0247: popup: popups may not wrap as expected
vim-patch:e09000a78 runtime(doc): Update examples in xxd.1 manpage
vim-patch:be7ef8a19 translation(it): Update Italian xxd man page

vim-patch:9.2.0242: memory leak in check_for_cryptkey()
vim-patch:9.2.0243: memory leak in change_indent()
vim-patch:9.2.0244: memory leak in eval8()
vim-patch:9.2.0246: memory leak in globpath()
2026-03-26 05:49:02 -04:00
Willaaaaaaa
c9e961994b refactor: resize Progress autocmd dict to actual size #38487
Problem:
  The temp_dict in `do_autocmd_progress()` is sized 7, but the max is 6 (id, text, percent, status, title, data). The extra capacity is rather misleading.

Solution:
  make the size of the dict 6.
2026-03-25 17:00:46 -04:00
Sean Dewar
b233f71b1b fix: :ball w_locked check, reset b_nwindows in free_all_mem() #38484
Problem:
- Small error in port of v9.1.0678, causing :ball to check w_locked for the
  wrong window.
- After #27439, free_all_mem() may not wipe out buffers that were open in more
  than one window before windows were freed.

Solution:
- Check win_locked() for wp in ex_buffer_all(), not curwin.
- Set b_nwindows to 0 in free_all_mem() before calling close_buffer().

Ref: https://github.com/neovim/neovim/pull/38473#issuecomment-4125117681
No need to block these fixes on that.

free_all_mem() change also looks like it fixed the existing "N lua references were
leaked!" warnings on the CI.
2026-03-25 10:47:12 +00:00
glepnir
4d04d0123d feat(api): nvim_set_hl{update:boolean} #37546
Problem: nvim_set_hl always replaces all attributes.

Solution: Add update field. When true, merge with existing
attributes instead of replacing. Unspecified attributes are preserved.
If highlight group doesn't exist, falls back to reset mode.
2026-03-25 06:01:50 -04:00
zeertzjq
781ea5b41b fix(exit): stop listening before closing channels (#38480)
Fixes the following flaky test on FreeBSD:

FAILED   test/functional/terminal/tui_spec.lua @ 218: TUI :restart works
test/functional/testterm.lua:223: Row 1 did not match.
Expected:
  |*^                                                  |
  |*{100:~                                                 }|
  |*{100:~                                                 }|
  |*{100:~                                                 }|
  |*{3:[No Name]                                         }|
  |*{MATCH:%d+ +}|
  |{5:-- TERMINAL --}                                    |
Actual:
  |*nvim: Failed to --listen: address already in use: |
  |*"/tmp/cirrus-ci-build/build/Xtest_tmpdir_terminal/|
  |*nvim.cirrus/LLdBdg/nvim.18878.1"                  |
  |*                                More info with "nv|
  |*im -h"                                            |
  |*[Proce^ss exited 1]                                |
  |{5:-- TERMINAL --}                                    |
2026-03-25 10:03:23 +08:00
luukvbaal
81828e66b9 fix(messages): emit empty msg_show event for :echo #38467
Problem:  No empty msg_show event for :echo without arguments.
Solution: Emit empty msg_show event when :echo is invoked without arguments.
2026-03-24 10:47:12 -04:00
Shadman
0af01948f3 fix(progress): show progress-status only in curwin #38458
Problem:
Currently same progress stat get's displayed on statusline of all
windows. This is repeatitive and noisy.

Solultion:
Only display progress-status on the focused window

Problem:
Currently, when multiple progress are on going we show it as Progress:
{N} items {percent}% format. It can be simplified sinnce items doesn't
really add enough value for the valuable space it takes in statusline

Solution:
Change format to Progress: {percent}%({N})
2026-03-24 08:28:44 -04:00
Justin M. Keyes
ebc9811149 Merge #38402 from justinmk/doc2 2026-03-24 06:56:01 -04:00
zeertzjq
416e542992 vim-patch:9.2.0233: Compiler warning in strings.c (#38450)
Problem:  Compiler warning in strings.c
          (Timothy Rice, after v9.2.0031)
Solution: Return early when str_m is zero
          (Hirohito Higashi)

fixes:  vim/vim#19795
closes: vim/vim#19800

347e8c1e7d

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-03-23 23:16:29 +00:00
Justin M. Keyes
a3b48b1054 docs: api, plugins, ui2 2026-03-24 00:14:55 +01:00
vanaigr
9170178ee5 fix: use correct window dimension for range estimation 2026-03-23 19:36:48 +01:00
vanaigr
20b2dd39cc fix(decor): clamp last column by decor provider range 2026-03-23 19:36:48 +01:00
Justin M. Keyes
3a3c6f0907 refactor: rename termcap.lua -> tty.lua #38437
Problem:
The `termcap.lua` module is too narrowly named. We may need a place for
tty-related functionality in the future.
https://github.com/neovim/neovim/pull/31399#discussion_r1882598297

Solution:
This isn't a public/documented interface, so just rename it.
2026-03-23 10:14:48 -04:00
Justin M. Keyes
fc21433167 fix(session): spacebar heater not warm enough #38434
Problem:
vim-obsession depends on the exact string "let SessionLoad = 1" being
present in session files. ed9dfc7c2c/plugin/obsession.vim (L36-L41)

Solution:
Revert cosmetic change from e12a9e7c4e.
2026-03-23 08:09:33 -04:00
skewb1k
9a5641b4b5 fix(lua): drop support for boolean buf in vim.keymap #38432
Problem:
`vim.keymap.*.Opts.buf` allows `boolean` aliases for more widely
used `integer?` values, `true` -> `0` and `false` -> `nil`. This
conversion is unnecessary and can be handled at call sites.

Solution:
As a follow-up to deprecating the `buffer` option, drop support for
boolean values for the new `buf` option. The deprecated `buffer`
continues to support booleans for backward compatibility.
2026-03-23 08:00:53 -04:00
github-actions[bot]
d7e534d6b3 docs: update version.c #38304
vim-patch:9.2.0166: Coverity warning for potential NULL dereference
vim-patch:9.2.0170: channel: some issues in ch_listen()
vim-patch:9.2.0173: tests: Test_balloon_eval_term_visual is flaky
vim-patch:9.2.0177: Vim9: Can set environment variables in restricted mode
vim-patch:9.2.0183: channel: using deprecated networking APIs
vim-patch:9.2.0187: MS-Windows: rendering artifacts with DirectX renderer
vim-patch:2b70de167 CI: bump actions/upload-artifact to v7
vim-patch:a907a7f73 runtime(doc): disable color codes when generating ascii man pages in Makefile
vim-patch:c9e5aeff3 runtime(doc): Update Italian xxd manpage
vim-patch:9.2.0210: tests: Test_xxd tests are failing
vim-patch:9774651ec runtime(manpager): Strip OSC 8 hyperlink sequences in manpager plugin
vim-patch:9.2.0220: MS-Windows: some defined cannot be set on Cygwin/Mingw
vim-patch:9.2.0224: channel: 2 issues with out/err callbacks
vim-patch:243dcd1bc translation(it): Update Italian xxd man page
vim-patch:9.2.0230: popup: opacity not working accross vert splits
vim-patch:9.2.0231: Amiga: Link error for missing HAVE_LOCALE_H

vim-patch:9.2.0176: external diff is allowed in restricted mode
vim-patch:9.2.0188: Can set environment variables in restricted mode
vim-patch:9.2.0191: feat(has): add support for 'android' and 'termux' feature flags
2026-03-23 07:28:15 -04:00
zeertzjq
0a60f32af3 refactor(move.c): fix coverity warning (#38427)
*** CID 645128:         Integer handling issues  (INTEGER_OVERFLOW)
/src/nvim/move.c: 2071             in scroll_cursor_bot()
2065           used += boff.height;
2066           if (used > wp->w_view_height) {
2067             break;
2068           }
2069           if (extra < (mouse_dragging > 0 ? mouse_dragging - 1 : so)
2070               || scrolled < min_scroll) {
>>>     CID 645128:         Integer handling issues  (INTEGER_OVERFLOW)
>>>     Expression "extra", where "boff.height" is known to be equal to 2147483647, overflows the type of "extra", which is type "int".
2071             extra += boff.height;
2072             if (boff.lnum >= wp->w_botline
2073                 || (boff.lnum + 1 == wp->w_botline
2074                     && boff.fill > wp->w_filler_rows)) {
2075               // Count screen lines that are below the window.
2076               scrolled += boff.height;
2026-03-23 03:30:17 +00:00
zeertzjq
e51f217be7 vim-patch:9.2.0223: Option handling for key:value suboptions is limited (#38426)
Problem:  Option handling for key:value suboptions is limited
Solution: Improve :set+=, :set-= and :set^= for options that use
          "key:value" pairs (Hirohito Higashi)

For comma-separated options with P_COLON (e.g., diffopt, listchars,
fillchars), :set += -= ^= now processes each comma-separated item
individually instead of treating the whole value as a single string.

For :set += and :set ^=:
- A "key:value" item where the key already exists with a different value:
  the old item is replaced.
- An exact duplicate item is left unchanged.
- A new item is appended (+=) or prepended (^=).

For :set -=:
- A "key:value" or "key:" item removes by key match regardless of value.
- A non-colon item removes by exact match.

This also handles multiple non-colon items (e.g., :set
diffopt-=filler,internal) by processing each item individually, making
the behavior order-independent.

Previously, :set += simply appended the value, causing duplicate keys to
accumulate.

fixes:  vim/vim#18495
closes: vim/vim#19783

e2f4e18437

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:13:48 +08:00
zeertzjq
fae782557c vim-patch:9.2.0226: No 'incsearch' highlighting support for :uniq (#38425)
Problem:  No 'incsearch' highlighting support for :uniq
Solution: Add :uniq support (Hirohito Higashi)

closes: vim/vim#19780

48137e4e48

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-03-23 09:38:48 +08:00
zeertzjq
11b9ec38d2 vim-patch:9.2.0222: "zb" scrolls incorrectly with cursor on fold (#38423)
Problem:  "zb" scrolls incorrectly with cursor on fold.
Solution: Set w_botline to the line below the fold (zeertzjq).

related: neovim/neovim#38413
closes:  vim/vim#19785

5a3b75d67b
2026-03-23 07:12:08 +08:00
Justin M. Keyes
e12a9e7c4e docs: starting.txt new layout 2026-03-22 01:57:28 +01:00
skewb1k
4d3a67cd62 feat(lua): replace buffer with buf in vim.keymap.set/del #38360
The `buffer` option remains functional but is now undocumented.
Providing both will raise an error. Since providing `buf` was disallowed
before, there is no code that will break due to using `buffer` alongside
`buf`.
2026-03-21 12:00:06 -04:00
zeertzjq
a969e92249 vim-patch:9.2.0219: call stack can be corrupted (#38406)
Problem:  call stack can be corrupted, because calculated remaining
          capacity for call stack string can underflow (after v9.1.1983)
Solution: Calculate capacity against maximum capacity
          (Sergey Vlasov).

closes: vim/vim#19759

8e0483c2f4

Co-authored-by: Sergey Vlasov <sergey@vlasov.me>
2026-03-21 22:51:09 +08:00
Justin M. Keyes
c257d8abed Merge #38370 from justinmk/doc2 2026-03-20 18:51:36 -04:00
tao
7be4e4dd65 fix(pty): prevent orphan conhost.exe on Windows 10 #38244
Problem:
On Windows 10, the ConPTY closing order is strict. Calling
ClosePseudoConsole after closing the output stream can easily
lead to accidental deadlocks, leaving orphan conhost.exe processes.
See https://learn.microsoft.com/en-us/windows/console/closepseudoconsole#remarks
and https://learn.microsoft.com/en-us/windows/console/creating-a-pseudoconsole-session#ending-the-pseudoconsole-session

Solution:
Based on the warning in the docs above, we need to call ClosePseudoConsole
on a separate thread first so that the output pipe can fully drain on
the main thread. Also, `wait_eof_timer` is outdated, so I removed it
to avoid extra cleanup logic around it (it was introduced in the
early winpty days).

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-20 18:42:41 -04:00
Justin M. Keyes
e3a1e47bb2 docs: misc 2026-03-20 23:30:09 +01:00
Justin M. Keyes
cd71221250 fix(intro): crash on small screen #38397 2026-03-20 22:23:39 +00:00
Evgeni Chasnovski
9595f07425 feat(ux): sexy intro #38378
Problem: Intro is not sexy.

Solution: Make it sexy.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-03-20 16:56:00 -04:00
Shadman
24684f90ea feat(progress): status api, 'statusline' integration #35428
Problem:
Default statusline doesn't show progress status.

Solution:
- Provide `vim.ui.progress_status()`.
- Include it in the default 'statusline'.

How it works:
Status text summarizes "running" progress messages.
 - If none: returns empty string
 - If one running item: "title:  percent%"
 - If multiple running items: "Progress: N items avg-percent%"
2026-03-20 07:18:20 -04:00
zeertzjq
238d4fa71a fix(terminal): possible missing refresh with buffer updates (#38388)
Problem:
Terminal refresh may be missed if buffer update callbacks poll for uv
events. Example test failure on FreeBSD:

FAILED   test/functional/terminal/buffer_spec.lua @ 1049: :terminal buffer scrollback is correct if buffer update callbacks poll for uv events
test/functional/terminal/buffer_spec.lua:1004: Row 1 did not match.
Expected:
  |*19995: TEST{MATCH: +}|
  |*19996: TEST{MATCH: +}|
  |*19997: TEST{MATCH: +}|
  |*19998: TEST{MATCH: +}|
  |*19999: TEST{MATCH: +}|
  |^[Process exited 0]                                |
  |{5:-- TERMINAL --}                                    |
Actual:
  |*19696: TEST                                       |
  |*19697: TEST                                       |
  |*19698: TEST                                       |
  |*19699: TEST                                       |
  |*19700: TEST                                       |
  |^[Process exited 0]                                |
  |{5:-- TERMINAL --}                                    |

Solution:
Call changed_lines() after resetting invalid region in refresh_screen().
Handle terminal being invalidated in the middle of refresh_timer_cb().
2026-03-20 12:05:19 +08:00
zeertzjq
d36e7787c1 vim-patch:9.2.0209: freeze during wildmenu completion (#38386)
Problem:  Vim may freeze if setcmdline() is called while the wildmenu or
          cmdline popup menu is active (rendcrx)
Solution: Cleanup completion state if cmdbuff_replaced flag has been set
          (Yasuhiro Matsumoto)

fixes:  vim/vim#19742
closes: vim/vim#19744

332dd22ed4

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-03-20 08:44:01 +08:00
zeertzjq
f577e05522 vim-patch:9.2.0202: [security]: command injection via newline in glob() (#38385)
Problem:  The glob() function on Unix-like systems does not escape
          newline characters when expanding wildcards. A maliciously
          crafted string containing '\n' can be used as a command
          separator to execute arbitrary shell commands via
          mch_expand_wildcards(). This depends on the user's 'shell'
          setting.
Solution: Add the newline character ('\n') to the SHELL_SPECIAL
          definition to ensure it is properly escaped before being
          passed to the shell (pyllyukko).

closes: vim/vim#19746

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-w5jw-f54h-x46c

645ed6597d

Co-authored-by: pyllyukko <pyllyukko@maimed.org>
2026-03-20 08:19:52 +08:00
glepnir
531442ddd8 fix(ui): apply 'pumborder' to mouse menu, fix overflow #36193
Problem:
Mouse popup menus (right-click context menus) do not respect the
'pumborder' option and could overflow screen boundaries when borders
were enabled near the edge.

Solution:
- Remove the mouse menu exclusion from border rendering.
- Add boundary check to shift menu left when border would exceed screen
  width, ensuring complete visibility of menu content and borders.
2026-03-19 13:11:35 -04:00
zeertzjq
4c48f19e51 vim-patch:partial:9.2.0193: using copy_option_part() can be improved (#38369)
Problem:  using copy_option_part() can be improved
Solution: Refactor and use the return value of copy_option_part() to
          avoid strlen() calls (John Marriott).

In addition, this commit includes the following changes:

memline.c:
- In recover_names():
  - Replace calls to vim_strsave() with vim_strnsave() for the literal
    strings
  - Use a string_T to store local variable dir_name.

bufwrite.c:
- In buf_write()
  - move variable wp to where it is used.

help.c:
- In fix_help_buffer():
  - replace call to add_pathsep() with after_pathsep()

optionstr.c:
- In export_myvimdir():
  - use a string_T to store local variable buf
  - replace call to add_pathsep() with after_pathsep()

scriptfile.c:
- In do_in_path():
  - use a string_T to store local variable buf
  - measure the lengths of prefix and name once before the while loop
  - replace call to add_pathsep() with after_pathsep()
  - move some variables closer to where they are used

spellfile.c:
- In init_spellfile():
  - use a string_T to store local variable buf

closes: vim/vim#19725

a74e5fc5b9

Co-authored-by: John Marriott <basilisk@internode.on.net>
2026-03-19 10:31:11 +00:00
zeertzjq
7d6b6b2d14 fix(terminal): don't poll for output during scrollback refresh (#38365)
Problem:
If buffer update callbacks poll for uv events during terminal scrollback
refresh, new output from PTY process may lead to incorrect scrollback.

Solution:
Don't poll for output to the same terminal as the one being refreshed.
2026-03-19 18:16:57 +08:00