Commit Graph

23311 Commits

Author SHA1 Message Date
Yasuhiro Matsumoto 309332a32e patch 9.2.0274: BSU/ESU are output directly to the terminal
Problem:  BSU/ESU are output directly to the terminal
Solution: Route them through out_buf() and flush the output directly,
          increase the OUT_SIZE terminal buffer (Yasuhiro Matsumoto)

Route synchronized-output control sequences through out_buf and flush
explicitly at protocol boundaries, instead of forcing BSU/ESU through
ui_write() directly.

Also increase the terminal output buffer from 2047 to 8191 bytes so
large redraws are emitted in fewer writes.

The important guarantee here is terminal-visible ordering: BSU must
reach the terminal before the batched redraw bytes, ESU must reach the
terminal after them, and FLUSH must emit ESU and BSU together, then
flush immediately.

Benchmark: PTY redraw workload with TERM=xterm-256color, long wrapped
lines, cursorline, listchars, horizontal scrolling, and repeated redraw!.

write syscalls: 8514 -> 5094 (-40.2%)
wall time: 0.568s -> 0.495s (-12.9%) on valid runs in this environment

closes: #19862

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0274
2026-03-31 16:34:23 +00:00
Christian Brabandt ac18dff65a patch 9.2.0273: tabpanel: undefined behaviour with large tabpanelop columns
Problem:  tabpanel: undefined behaviour with large tabpanelop columns
          (Michał Majchrowicz)
Solution: Error out for too large column values

Co-authored-by: Michał Majchrowicz <mmajchrowicz@afine.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0273
2026-03-31 16:13:25 +00:00
RestorerZ e4502b6037 translation(ru): updated lang/README.ru.txt
closes: #19865

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-31 15:51:32 +00:00
RestorerZ f4f175332c translation(ru): updated the Russian man page the xxd
closes: #19867

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-31 15:49:44 +00:00
Thomas Braun 12c6417587 runtime(sshconfig): Add missing kex algorithm
These are available already with openssh 10.2p1.

closes: #19864

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-31 15:46:04 +00:00
Christian Brabandt 374f06ffd8 runtime(racket): Use shellescape() to harden the K mapping
fyi: @benknoble

Co-authored-by: Michał Majchrowicz <mmajchrowicz@afine.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-31 15:38:30 +00:00
zeertzjq b5efce0765 Fix a few typos in tests
closes: #19871

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-31 15:20:08 +00:00
Christian Brabandt e551e71d7e runtime(tera): use fnameescape() when loading separate syntax files
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-31 15:04:48 +00:00
RestorerZ 70afdfc127 translation(ru): updated translations
closes: #19868

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-30 10:32:10 +00:00
Christian Brabandt 068c0604c9 runtime(rustfmt): not correctly escaping directory names
Problem:  runtime(rustfmt): not correctly escaping directory names
Solution: Use fnamescape() (Michał Majchrowicz)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-30 10:18:35 +00:00
Christian Brabandt 91900b9a5c runtime(vimgoto): Not correctly escaping the filanems
Problem:  runtime(vimgoto): not correctly escaping the filenames
Solution: Use fnamescape() (Michał Majchrowicz)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-30 10:15:19 +00:00
Christian Brabandt aa5c9310f5 runtime(typeset): Use fnameescape() for the :lcd command
Problem:  runtime(typeset) does not escape the detected directory
Solution: Use fnameescape() (Michał Majchrowicz)

fyi @lifepillar

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-30 10:12:03 +00:00
Christian Brabandt 84a8ee4353 runtime(context): use fnameescape() for the Log command
Problem:  runtime(context) does not escape the detected log file
Solution: Use fnameescape() (Michał Majchrowicz)

fyi @lifepillar

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-30 09:58:07 +00:00
Christian Brabandt 664701eb75 patch 9.2.0272: [security]: 'tabpanel' can be set in a modeline
Problem:  'tabpanel' can be set in a modeline
Solution: Set the P_MLE flag for the 'tabpanel' option, disable
          autocmd_add()/autocomd_delete() functions in restricted/secure
          mode.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-2gmj-rpqf-pxvh

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0272
2026-03-30 08:50:10 +00:00
Koda Reef 3c0f8000e1 patch 9.2.0271: buffer underflow in vim_fgets()
Problem:  buffer underflow in vim_fgets()
Solution: Ensure size is always greater than 1
          (Koda Reef)

Signed-off-by: Koda Reef <kodareef5@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0271
2026-03-29 15:30:11 +00:00
Paul Ollis 211ceea602 patch 9.2.0270: test: trailing spaces used in tests
Problem:  test: trailing spaces used in tests
Solution: Rewrite tests to avoid trailing spaces (Paul Ollis).

Some tests currently rely on trailing whitespace at the end of lines,
escaped with '\'. I have demonstrated in another PR, such spaces can be
inadvertently removed and this is difficult to spot.

Note: there are more trailing spaces in a few more test files, see
testdir/test_codestyle.vim. Those are not yet removed.

closes: #19838

Signed-off-by: Paul Ollis <paul@cleversheep.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0270
2026-03-29 14:21:11 +00:00
Christian Brabandt b8a653a377 patch 9.2.0269: configure: Link error on Solaris
Problem:  configure: Link error on Solaris
          (idgn23, after v9.2.0153)
Solution: Move the check for the nsl library a bit earlier,
          regenerate configure

fixes: #19803

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0269
2026-03-29 14:00:51 +00:00
Huihui Huang 30bac359dc patch 9.2.0268: memory leak in call_oc_method()
Problem:  memory leak in call_oc_method()
Solution: Clean up argvars in the failure case
          (Huihui Huang)

closes: #19828

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0268
2026-03-29 13:56:42 +00:00
rendcrx 466b5f531a patch 9.2.0267: 'autowrite' not triggered for :term
Problem:  'autowrite' not triggered for :term
Solution: Trigger autowrite for :term command
          (rendcrx)

closes: #19855

Signed-off-by: rendcrx <974449413@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0267
2026-03-29 09:22:48 +00:00
Yasuhiro Matsumoto 8ea5f27745 patch 9.2.0266: typeahead buffer overflow during mouse drag event
Problem:  typeahead buffer overflow during mouse drag event
Solution: Change the guard from 5 to 10 to account for the worst case
          (Yasuhiro Matsumoto).

The typeahead buffer guard in mch_inchar() only reserved 5 bytes per
iteration, but a mouse event writes up to 7 bytes (3 header + 4
coordinates) and a scroll event with modifiers writes up to 10 bytes
(3 modifier + 3 scroll + 4 coordinates).  During fast mouse dragging,
3+ events could queue up and overflow the 20-byte buffer, corrupting
adjacent static variables and causing garbage bytes (including Ctrl-Z)
to be fed into the input stream, which triggered nv_suspend/ex_stop.

closes: #19851

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0266
2026-03-29 09:15:14 +00:00
thinca f89662722d patch 9.2.0265: unnecessary restrictions for defining dictionary function names
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: #19833

Signed-off-by: thinca <thinca@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0265
2026-03-28 10:07:27 +00:00
Julio B d13f135295 patch 9.2.0264: Cannot disable kitty keyboard protocol in vim :terminal
Problem:  Cannot disable kitty keyboard protocol in vim :terminal
Solution: Handle "CSI <u" sequence in libvterm (Julio B).

related: v9.0.0930
closes: #19837

Signed-off-by: Julio B <julio.bacel@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0264
2026-03-28 10:01:38 +00:00
Yasuhiro Matsumoto 8e29c35a04 patch 9.2.0263: hlset() cannot handle attributes with spaces
Problem:  hlset() cannot handle attributes with spaces
Solution: Handle attributes with spaces by quoting those
          (Yasuhiro Matsumoto).

hlset(hlget('Normal')) fails with E416 when a highlight attribute value
contains spaces (e.g. font name "Monospace 10"). hlg_add_or_update()
builds a string like "font=Monospace 10" and passes it to do_highlight(),
whose parser splits on whitespace and treats "10" as a separate key
without "=".

Fix by quoting values with single quotes (e.g. font='Monospace 10')
when the value contains spaces and the attribute is a key=value pair.
do_highlight() already supports single-quoted values.

closes: #19843

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0263
2026-03-28 09:47:15 +00:00
Pierluigi Lenoci 80a0c355cf patch 9.2.0262: invalid lnum when pasting text copied blockwise
Problem:  invalid lnum when pasting text copied blockwise
          (KillTheMule)
Solution: Subtract nr_lines from curwin->w_cursor.lnum when calling
          changed_lines() in do_put() (Pierluigi Lenoci)

When doing a blockwise paste beyond the end of the buffer, new lines are
appended and nr_lines is incremented accordingly. However, the
changed_lines() call used curwin->w_cursor.lnum as the "lnume" argument
(the first line below the changed lines BEFORE the change), which is
incorrect because the cursor has already been moved past the newly
appended lines.

Fix by subtracting nr_lines from curwin->w_cursor.lnum, so that lnume
correctly reflects the state before the change, as documented in
changed_lines().

Add a listener test to verify the correct values are reported.

Port of neovim/neovim#12733.

fixes:  #6660
closes: #19844

Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0262
2026-03-27 15:49:27 +00:00
Yasuhiro Matsumoto 54b6c0c0e7 patch 9.2.0261: terminal: redraws are slow
Problem:  terminal: redraws are slow (Mao-Yining)
Solution: Disable redrawing in handle_movecursor()
          (Yasuhiro Matsumoto)

handle_movecursor callback was calling update_cursor() with redraw=TRUE
on every cursor move inside vterm_input_write(). This triggered
gui_mch_flush() (GdiFlush + DWriteContext_Flush) and TextChangedT
autocmd for each cursor move. ConPTY output contains ~17 cursor moves
per 4KB chunk, each flush taking ~5ms, resulting in 80-110ms per chunk.

Fix by passing FALSE to update_cursor() in handle_movecursor since
write_to_term() already calls update_cursor() with proper redraw after
vterm_input_write() finishes.

Also set vterm_screen_set_damage_merge() to VTERM_DAMAGE_SCROLL so that
damage callbacks are buffered until vterm_screen_flush_damage() instead
of being emitted per cell.

fixes:  #19845
closes: #19846

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0261
2026-03-26 22:12:52 +00:00
Yasuhiro Matsumoto 575961c791 patch 9.2.0260: statusline not redrawn after closing a popup window
Problem:  When a popup window overlapping a status line is closed or
          hidden, the status line is not redrawn, leaving ghost
          artifacts from the popup.
Solution: popup_free() and popup_hide() call
          redraw_all_later(UPD_NOT_VALID) which marks window contents
          for redraw but does not set w_redr_status. The diff-based path
          in may_update_popup_mask() that normally sets w_redr_status
          is skipped when redrawing_all_win is TRUE. Add status_redraw_all
          calls to ensure status lines are properly redrawn
          (Yasuhiro Matsumoto).

closes: #19830

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0260
2026-03-26 21:19:34 +00:00
Yasuhiro Matsumoto f6e1dd11f4 patch 9.2.0259: tabpanel: corrupted display during scrolling causing flicker
Problem:  tabpanel: corrupted tabpanel during scrolling causing flicker
Solution: When the tabpanel is visible, force a line-by-line redraw in
          win_do_lines() similarly to popup handling (Yasuhiro Matsumoto).

When a vertical tabpanel is visible, terminal scroll operations in
win_do_lines() affect the full screen width, corrupting the tabpanel
area. The tabpanel is then redrawn via redraw_tabpanel, causing visible
flicker. Return FAIL to force line-by-line redraw instead, analogous to
the existing popup_visible check.

closes: #19832

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0259
2026-03-26 21:03:46 +00:00
Huihui Huang b90145672d patch 9.2.0258: memory leak in add_mark()
Problem:  memory leak in add_mark()
Solution: Free lpos in the error case when it hasn't been added to the
          dict yet (Huihui Huang)

closes: #19827

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0258
2026-03-26 20:59:03 +00:00
Shane Harper 02abcf381f patch 9.2.0257: unnecessary memory allocation in set_callback()
Problem:  Unnecessary memory allocation in set_callback(); after
          set_callback(), callers must manually free the source
          callback's name if cb_free_name is set.
Solution: Refactor set_callback() to re-use the callback name when
          possible to avoid extra memory allocations and clean up so the
          callers do not have to take care themselves (Shane Harper).

closes: #19831

Signed-off-by: Shane Harper <shane@shaneharper.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0257
2026-03-26 20:46:52 +00:00
zeertzjq 06aa378056 patch 9.2.0256: visual selection size not shown in showcmd during test
Problem:  The visual selection size is not displayed in the showcmd area
          when entering visual mode from a script or mapping, because
          char_avail() incorrectly reports input as pending. This causes
          test failure on CI with the ASAN CI runner.
Solution: Replace char_avail() with explicit checks for an empty stuff
          buffer, empty typeahead buffer, and not running a script
          (zeertzjq).

related: #19801
closes:  #19824

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0256
2026-03-26 20:38:39 +00:00
Christian Brabandt 96898d7324 patch 9.2.0255: tests: Test_popup_opacity_vsplit() fails in a wide terminal
Problem:  tests: Test_popup_opacity_vsplit() fails in a wide terminal
          (after v9.2.0230)
Solution: Reduce terminal window size to 60, force termguicolors to make
          the opacity visible; enable termguicolors so that the opacity
          is visually apparent in the screen dump.

related: #19824

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0255
2026-03-26 20:35:34 +00:00
Sean Dewar 7cb43f286e patch 9.2.0254: w_locked can be bypassed when setting recursively
Problem:  w_locked can be bypassed when recursively set if not restored
          to its prior value.
Solution: Rather than save/restore everywhere, just make it a count,
          like other locks (Sean Dewar)

Requires the previous commit, otherwise b_nwindows will be wrong in
tests, which causes a bunch of weird failures.

closes: #19728

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0254
2026-03-26 20:27:56 +00:00
Sean Dewar bf21df1c7b patch 9.2.0253: various issues with wrong b_nwindows after closing buffers
Problem:  close_buffer() callers incorrectly handle b_nwindows,
          especially after nasty autocmds, allowing it to go
          out-of-sync.  May lead to buffers that can't be unloaded, or
          buffers that are prematurely freed whilst displayed.
Solution: Modify close_buffer() and review its callers; let them
          decrement b_nwindows if it didn't unload the buffer.  Remove
          some now unneeded workarounds like 8.2.2354, 9.1.0143,
          9.1.0764, which didn't always work (Sean Dewar)

close_buffer() now doesn't decrement b_nwindows when not unloading buf, or when
buf isn't w_buffer after autocmds (they would've already decremented it).
Callers are now expected to decrement b_nwindows if w_buffer is not NULL after
close_buffer(), and when still intending to switch buffers or close win, for two
reasons:
- close_buffer() autocmds may have switched buffers.  The new w_buffer's
  b_nwindows would also need decrementing.
- After close_buffer(), callers may opt to not switch w_buffer or close win.
  b_nwindows would need to be incremented again.  (unless w_buffer is NULL from
  being unloaded; callers are already forced to find a new buffer then)
These were the main causes of b_nwindows bugs, as these cases could not be
reliably detected, and went largely unhandled.

NOTE: if close_buffer() autocmds switch buffers, close_buffer() is not called
for that new buffer before decrementing b_nwindows.  This may skip side-effects
like from 'bufhidden', but I think it's mostly harmless, and was already
happening in other places.

Let's see how this goes...  Other details: (I have lots to say!)

It's OK to pass a win to close_buffer() that isn't showing buf (used by
set_curbuf()).  In that case, we skip some side-effects and don't decrement
b_nwindows, but may still unload buf if hidden.

buf_freeall() now returns whether it freed anything.  Removes some repeated
checks in close_buffer().

Preserve close_buffer()'s behaviour when called by win_free_popup() after its
popup was already removed from the window list.  This made win_valid_any_tab()
return FALSE, so we skip things that originally checked it in that case.

Add "set_context" to close_buffer() to preserve do_ecmd()'s behaviour of only
setting b_last_cursor and/or calling buflist_setfpos() when not splitting
(see 7.2.041: https://groups.google.com/g/vim_dev/c/ZGgNvaylNzI/m/WHxjhnuxqB0J)
Without this, Test_marks_cmd() fails from its ' mark differing.  Don't use
oldwin though; it's not always the window with the closed buf, especially
after BufLeave autocmds in do_ecmd().  Also, only set context if win is really
displaying buf.

Don't bail in do_ecmd() if buf was deleted but curwin->w_buffer is NULL; that
leaves curwin open to a NULL buffer!  Use lastbuf instead, like set_curbuf().
I don't think it's possible for buf to be deleted by close_buffer() anyway, as
b_locked was set (which I can't see a way to bypass, unlike b_locked_split).
Maybe such checks can be removed, but I'd rather not risk that here.

Don't set curwin to previouswin in set_curbuf(); shouldn't be needed, otherwise
may lead to curbuf != curwin->w_buffer if autocmds switch to a window showing
buf, as that skips enter_buffer()?  Was introduced back in 7.3.557 to avoid
cases where autocmds switch windows, possibly leaving previouswin with a NULL
buffer.  Since 7.4.2312 and 7.4.2328, close_buffer() and buf_freeall() already
handles this.  I've added an assert() as a sanity check anyway.

In free_all_mem(), set b_nwindows to 0 before close_buffer() so buffers can be
wiped if still in a window before win_free_all().  Needed as close_buffer() now
skips unloading buffers that aren't hidden if win is NULL.  If it's possible for
free_all_mem()'s :tabonly! and :only! to not close all windows before freeing,
then this issue was also previously possible if b_nwindows > 1.

related: #19728

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0253
2026-03-26 20:27:47 +00:00
Sean Dewar a8fdfd4fcb patch 9.2.0252: Crash when ending Visual mode after curbuf was unloaded
Problem:  if close_buffer() in set_curbuf() unloads curbuf, NULL pointer
          accesses may occur from enter_buffer() calling
          end_visual_mode(), as curbuf is already abandoned and possibly
          unloaded.  Also, selection registers may not contain the
          selection with clipboard+=autoselect(plus).
Solution: Move close_buffer()'s end_visual_mode() call to buf_freeall(), after
          any autocmds that may restart it, but just before freeing anything
          (Sean Dewar)

related: #19728

Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0252
2026-03-26 20:05:31 +00:00
Yasuhiro Matsumoto 68b3585e1d patch 9.2.0251: Link error when building without channel feature
Problem:  Compile error when building without channel feature
          (John Marriott, after v9.2.0250)
Solution: Update ifdefs and move implementation out of FEAT_JOB_CHANNEL
          (Yasuhiro Matsumoto)

Move build_argv_from_list() and mch_get_cmd_output_direct() out of
FEAT_JOB_CHANNEL guards so that system() with a List argument works
in builds that have FEAT_EVAL but not FEAT_JOB_CHANNEL (e.g.
FEAT_NORMAL without GUI).

related: #19791
closes:  #19826

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0251
2026-03-26 19:32:49 +00:00
Ola Söder c84526dd29 runtime(amiga): revamp syntax highlighting and add new maintainer
closes: #19825

Signed-off-by: Ola Söder <rolfkopman@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-26 19:25:30 +00:00
Antonio Giovanni Colombo be7ef8a19e translation(it): Update Italian xxd man page
Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-25 22:11:55 +00:00
Antonio Giovanni Colombo e09000a786 runtime(doc): Update examples in xxd.1 manpage
Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-25 22:10:09 +00:00
Yasuhiro Matsumoto 30f012d8bc patch 9.2.0250: system() does not support bypassing the shell
Problem:  system() and systemlist() only accept a String, requiring
          manual shell escaping for arguments with special characters.
Solution: Accept a List as the first argument and execute the command
          bypassing the shell (Yasuhiro Matsumoto).

fixes:  #19789
closes: #19791

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0250
2026-03-25 22:04:13 +00:00
Foxe Chen bde5832216 patch 9.2.0249: clipboard: provider reacts to autoselect feature
Problem:  clipboard: provider reacts to autoselect feature
Solution: Disable autoselection when using clipboard provider feature
          (Foxe Chen).

closes: #19812

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0249
2026-03-25 21:30:59 +00:00
Yasuhiro Matsumoto af3ccc2845 patch 9.2.0248: json_decode() is not strict enough
Problem:  json_decode() accepted keywords case-insensitively, violating
          RFC 7159. Both json_decode() and js_decode() silently accepted
          lone surrogates, which are invalid Unicode.
Solution: Only allow lowercase keyword in json_decode(), reject lone
          surrogates, improve encoding performance in write_string() and
          blob byte serialization.

1. Fix surrogate pair range check (0xDFFF -> 0xDBFF) so only high
   surrogates trigger pair decoding. Reject lone surrogates that do
   not form a valid pair instead of producing invalid UTF-8.
2. Use case-sensitive matching for JSON keywords (true, false, null,
   NaN, Infinity) in json_decode() per RFC 7159. js_decode() retains
   case-insensitive behavior.
3. Replace double ga_append() calls for escape sequences with single
   GA_CONCAT_LITERAL() calls, halving function call and buffer growth
   check overhead.
4. Replace vim_snprintf_safelen() for blob byte encoding (0-255) with
   direct digit conversion.

closes: #19807

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0248
2026-03-25 21:20:21 +00:00
Hirohito Higashi c0f0a34ea3 patch 9.2.0247: popup: popups may not wrap as expected
Problem:  popup: popups may not wrap as expected
          (Enrico Maria De Angelis, after v9.1.0949)
Solution: don't shift popupwin left when 'wrap' is on and maxwidth is
          set (Hirohito Higashi)

When a non-fixed popup with 'wrap' enabled and an explicit maxwidth was
placed near the right edge of the screen, the shift-left logic increased
maxwidth beyond the user-specified value, preventing text from wrapping.

Instead cap the shift amount so that maxwidth does not exceed w_maxwidth
when wrapping is enabled, letting text wrap as expected.

fixes:  #19767
closes: #19809

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0247
2026-03-25 20:12:28 +00:00
Huihui Huang 418400075a patch 9.2.0246: memory leak in globpath()
Problem:  memory leak in globpath()
Solution: Free the individual allocated strings when ga_grow() fails
          (Huihui Huang)

closes: #19817

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0246
2026-03-25 19:51:42 +00:00
Hirohito Higashi 1578ea9d97 patch 9.2.0245: xxd: color output detection is broken
Problem:  xxd: color output detection is broken
          (Juergen Weigert)
Solution: Fix the issues (Hirohito Higashi)

- Disable auto color when output goes to a file (two-argument form)
- Check TERM variable: disable color when unset, empty or "dumb"
- Add color_forced flag to preserve -R always behavior
- Add tests for the new behavior

fixes:  #19790
closes: #19813

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0245
2026-03-25 19:38:51 +00:00
Huihui Huang e2cf84d0a0 patch 9.2.0244: memory leak in eval8()
Problem:  memory leak in eval8()
Solution: Free type_list() even when evaluate is FALSE
          (Huihui Huang)

closes: #19819

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0244
2026-03-25 19:26:38 +00:00
Huihui Huang 0effd2faf9 patch 9.2.0243: memory leak in change_indent()
Problem:  memory leak in change_indent()
Solution: Free orig_line in the error case
          (Huihui Huang)

closes: #19820

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0243
2026-03-25 19:18:20 +00:00
Huihui Huang a4c0119786 patch 9.2.0242: memory leak in check_for_cryptkey()
Problem:  memory leak in check_for_cryptkey()
Solution: Free cryptkey if it had been allocated
          (Huihui Huang)

closes: #19821

Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0242
2026-03-25 19:11:13 +00:00
Christian Brabandt 742e8722b3 patch 9.2.0241: tests: Test_visual_block_hl_with_autosel() is flaky
Problem:  tests: Test_visual_block_hl_with_autosel() is flaky on ASAN CI
          (after v9.2.0221)
Solution: Add a TermWait() call

related: #19784

Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0241
2026-03-25 19:03:50 +00:00
Yasuhiro Matsumoto b435da0b4f patch 9.2.0240: syn_name2id() is slow due to linear search
Problem:  Looking up highlight group names uses a linear scan of the
          highlight table, which is slow at startup when many groups
          are defined.
Solution: Use a hashtable for O(1) highlight group name lookup.
          (Yasuhiro Matsumoto).

Benchmark (523 highlight groups, :highlight + highlight link + syntax
keyword + hlID() + redraw, 20 iterations):

master:      0.057 sec (~295,000 ops/sec)
this branch: 0.036 sec (~463,000 ops/sec)
speedup:     ~1.57x

closes: #19788

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
v9.2.0240
2026-03-24 20:47:27 +00:00
Aliaksei Budavei 955c02dff7 runtime(sh): Distinguish parts of function definitions
- Highlight keywords "function" and "namespace" with
  the "Keyword" group ("shFunctionKey").
- Highlight function body delimiters "{" and "}" with the
  "Delimiter" group ("shFunctionExprRegion").
- Highlight function body delimiters "(" and ")" with the
  "Operator" group ("shFunctionSubShRegion").
- Also, follow one style in folding all supported variants
  of function bodies for grouping commands too by enclosing
  a delimited function body, e.g. "{" and "}", in a fold and
  leaving its function header, e.g. "function f()", out of
  it when the header is written on a separate line.

To restore previous colouring, add to "after/syntax/sh.vim":
------------------------------------------------------------
hi link shFunctionKey Function
hi link shFunctionExprRegion Function
hi link shFunctionSubShRegion Function
------------------------------------------------------------

fixes:  https://github.com/vim/vim/pull/19638#issuecomment-4052635546
closes: #19638

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-03-24 20:36:23 +00:00