Problem: line('w0') moves cursor in terminal-normal mode
(Biebar, after v9.2.0127)
Solution: Check that the terminal is not in terminal-normal-mode
(Ozaki Kiichi).
fixes: #19717closes: #19718
Signed-off-by: Ozaki Kiichi <gclient.gaap@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: possible crash with winminheight=0
(Emilien Breton)
Solution: Use <= instead of < when checking reserved room in
frame_setheight() to correctly handle the zero-height
boundary case (Hirohito Higashi).
In frame_setheight(), when shrinking the current window and the only
other window has 'winfixheight' with 'winminheight'=0, room_reserved
was not cleared because the condition used '<' instead of '<='.
The freed rows were discarded, leaving fr_height sum less than
topframe fr_height. Subsequent resize operations then computed a
wrong room_cmdline that expanded topframe beyond the screen, causing
a crash.
fixes: #19706closes: #19712
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: Compile warning for converting from size_t to int
breaks the Appveyor CI (after v9.2.0168)
Solution: Explicitly cast to int in convert_string() (ichizok).
closes: #19722
Signed-off-by: ichizok <gclient.gaap@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim sends DEC mode query requests (DECRQM) regardless of the
terminal mode.
Solution: Only send DEC mode requests when cur_tmode is TMODE_RAW, but
e.g not for gui mode (Foxe Chen).
fixes: #19709closes: #19710
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: Can set environment variables in restricted mode
Solution: Disallow settings variables in exec_instructions() when in
restricted mode (pyllyukko)
related: #13394
closes: #19705
Signed-off-by: pyllyukko <pyllyukko@maimed.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: When 'diffopt' does not include "internal", Vim attempts to
execute an external diff command even in restricted mode.
This could be used to bypass restricted mode.
Solution: Call check_restricted() in diff_file() before attempting to
execute an external diff (pyllyukko).
closes: #19696
Signed-off-by: pyllyukko <pyllyukko@maimed.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: No tests for what v9.2.0141 and v9.2.0156 fixes
Solution: Add tests for using :perldo and rubeval() in sandbox mode
related: #19664
related: #19653
closes: #19699
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: When using 'diffopt=inline:word', lines were excessively
fragmented with punctuation creating separate highlight
blocks, making it harder to read the diffs.
Solution: Added 'diff_refine_inline_word_highlight()' to merge
adjacent diff blocks that are separated by small gaps of
non-word characters (up to 5 bytes by default) (HarshK97).
When using inline:word diff mode, adjacent changed words separated by
punctuation or whitespace are now merged into a single highlight block
if the gap between them contains fewer than 5 non-word characters.
This creates more readable diffs and closely matches GitHub's own diff
display.
closes: #19098
Signed-off-by: HarshK97 <harshkapse1234@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_balloon_eval_term_visual is flaky
Solution: Use redraw and WaitForAssert() to make it more reliable
Previously, it failed about 1 out of 4 runs for me, now I got it down to
1 out of 10. It's not perfect, but better than before.
closes: #19692
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Missing semicolon in os_mac_conv.c (after v9.2.0168)
Solution: Add it (Yasuhiro Matsumoto).
The missing semicolon was introduced in patch 9.2.0168
(b00f441e6), which breaks the macOS build.
closes: #19695
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: GetVersionEx() is deprecated since Windows 8.
Version checks for specific features (like dark mode or title
bar colors) are duplicated across files using multiple boolean flags.
Solution: Use RtlGetVersion() to centralize detection in a single
win_version variable. Use the MAKE_VER() macro to check
against major, minor, and build numbers. Update titlebar
colors and dark theme to use proper version thresholds
(Mao-Yining).
closes: #19673
Signed-off-by: Mao-Yining <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Corrected the translation for 'paste' from '粘帖' to '粘贴'.
In Chinese, the correct term for the computer action "paste" is 粘贴
(zhān tiē). The original translation used 粘帖, which contains a very
common typo. The second character was mistakenly written as 帖 (which
means a note or invitation) instead of the correct character 贴 (which
means to stick or paste).
closes: #19689
Signed-off-by: Murasame <88932464+CuteMurasame@users.noreply.github.com>
Signed-off-by: Mao-Yining <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: channel: some issues in ch_listen()
(char101, after v9.2.0153)
Solution: On MS-Windows, initialize using channel_init_winsock() and use
SO_EXCLUSIVEADDRUSE instead of SO_REUSEADDR, allow to use port
0 to have the OS assign a port (Yasuhiro Matsumoto).
related: #19231
closes: #19690
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
When system() or systemlist() is called without :silent from a
statusline expression, autocommand, or timer callback, the terminal
is temporarily set to cooked mode, which re-enables ECHO on the tty.
If a terminal response (e.g. DECRPM for cursor blink mode) arrives
during this window, the tty driver echoes it to the screen, leaving
stray characters that require CTRL-L to remove.
This behavior was intentionally addressed in patch 7.4.427 by
skipping cooked mode when :silent is prepended. However, the
documentation only mentioned this for system() and did not cover
systemlist() at all. The guidance to use :silent in non-interactive
contexts (statusline, autocommands, timers) was also not explicit.
closes#19691
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: assertion failure in syn_id2attr()
(@julio-b, after v9.2.0093)
Solution: Set tp_curwin to a valid window in popup_close_tabpage()
and return early in update_winhighlight() if there are
no highlight overrides to update (Foxe Chen).
fixes: #19650closes: #19670
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: invalid pointer casting in string_convert() arguments
Solution: Use a temporary local int variable (James McCoy)
string_convert()/string_convert_ext() accept an "int *lenp" parameter,
however a few call sites were taking the address of a possibly larger
type (long, size_t) and casting it as an int * when calling these
functions.
On big-endian platforms, this passes the (likely) zeroed high bytes of
the known length through to string_convert(). This indicates it received
an empty string and returns an allocated empty string rather than
converting the input. This is exhibited by test failures like
From test_blob.vim:
Found errors in Test_blob2str_multi_byte_encodings():
command line..script src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_blob2str_multi_byte_encodings line 2: Expected ['Hello'] but got ['']
command line..script src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_blob2str_multi_byte_encodings line 3: Expected ['Hello'] but got ['']
command line..script srctestdir/runtest.vim[636]..function RunTheTest[63]..Test_blob2str_multi_byte_encodings line 6: Expected ['Hello'] but got ['']
Instead, use a temporary local int variable as the in/out variable for
string_convert() and assign the result back to the larger typed length
variable post-conversion.
closes: #19672
Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: setting buftype=terminal may cause a crash
(lacygoill, after v9.2.0127)
Solution: Validate that curwin->w_buffer->b_term is not null
fixes: #19686closes: #19676
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity warning for potential NULL dereference in channel.c
(after v9.2.0153)
Solution: Use empty string in case hostname is NULL.
CID: 1686330
related: #19676
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: perleval fails in the sandbox
(after v9.2.0156)
Solution: Update tests and assert that it fails
related: #19676
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: build error when XCLIPBOARD is not defined
(Tony Mechelynck, after v9.2.0158)
Solution: Update ifdefs
related: #19676
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: intro message disappears on startup in some terminals
(chdiza, after v9.2.0139)
Solution: Only call set_shellsize() in handle_csi() if the reported
width or height actually differs from the current
Rows or Columns. (Foxe Chen)
fixes: #19656closes: #19660
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Crash when reading quickfix line (Kaiyu Xie)
Solution: Make sure line is terminated by NUL
closes: #19667
Supported by AI
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim could use the VisualNOS highlight group when not connected
to an X server.
Solution: Always highlight visual selections with Visual when not
connected to an X server (Shane Harper)
When Vim is running with X11 support it chooses between the Visual and
VisualNOS highlight groups for a visual selection based on whether it
believes it owns the X selection. According to :help hl-VisualNOS,
VisualNOS should only be used by the X11 GUI or when using the
xterm-clipboard feature, however, prior to this commit Vim could choose
VisualNOS when a clipboard provider was used, even when Vim was not
connected to an X server.
closes: #19659
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: concatenation can be improved
Solution: Cache string segments lengths in exe_concat() and avoid
strlen() calls (John Marriott).
closes: #19647
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Lua 5.5 makes for-loop control variables read-only.
The path-parsing logic in if_lua.c attempts to modify the
loop variable 's', causing the script to fail during
runtime initialization (Binbin Qian)
Solution: Use a Lua capture group in gmatch() to extract the path
without the semicolon, avoiding the need to re-assign
to the loop variable.
fixes: #19639closes: #19658
supported by AI
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim can only act as a channel client (ch_open). There is
no way for an external process to initiate a connection
to a running Vim instance using the Channel API.
Solution: Implement ch_listen() and the underlying server-side
socket logic. This allows Vim to listen on a port or
Unix domain socket. When a client connects, a new
channel is automatically created and passed to a
user-defined callback (Yasuhiro Matsumoto).
closes: #19231
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Problem: concatenating strings is slow
Solution: Use grow_string_tv() to grow the existing string buffer in
place when possible (Yasuhiro Matsumoto).
closes: #19642
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: blob_from_string() is slow for long strings
Solution: Use ga_grow() to allocate memory once, perform a bulk copy
with mch_memmove() then translate NL to NUL in-place
(Yasuhiro Matsumoto).
closes: #19665
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: When using synchronized terminal output, the internal
output buffer is not flushed before sending the
End Synchronized Update (ESU) sequence. This causes
redrawing artifacts.
Solution: Call out_flush() immediately before sending the ESU
sequence to ensure all pending drawing commands are
contained within the synchronized update window.
(Yasuhiro Matsumoto)
closes: #19662
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: do_unlet_var() unconditionally calls dictitem_remove() in its
final else branch, but for imported items lp->ll_dict is NULL,
causing a segfault (Peter Kenny)
Solution: Add a NULL check and return E1260 instead.
Affects :unlet at vim9script level and inside legacy :function.
The :def case already worked (handled in vim9cmds.c).
fixes: #19637closes: #19657
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Compile error when FEAT_DIFF is not defined (after v9.2.0144)
Solution: Add ifdefs around those lines (John Marriott).
related: #19622
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- ftplugin(sshdconfig): use "-I" for 'keywordprg' to search
case-insensitive in the man page
- syntax(sshdconfig,sshconfig): Mark "lowdelay", "throughput", and
"reliability" as deprecated for IPQoS, highlighting them as
errors/warnings to reflect OpenSSH 10.1p1 release
Reference:
https://www.openssh.org/releasenotes.html#10.1p1closes: #19636
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Jakub Jelen <jakuje@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: blob: concatenation can be improved
Solution: Use ga_grow() to allocate space once and mch_memmove() to copy
the blob data as a single block and fall back to the previous
byte by byte append (Yasuhiro Matsumoto).
closes: #19645
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: dictionary lookups can be improved
Solution: Replace the vim_strncpy() by mch_memmove() call.
(Yasuhiro Matsumoto).
closes: #19646
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim often calls utf_ptr2char() and utf_ptr2len() separately.
Solution: Refactor UTF-8 hot paths into utf_ptr2char_and_len() to
decode the codepoint and byte length in a single pass.
Fold combining character logic into the same optimized flow.
Improves redraw performance by ~8-10% in UTF-8 heavy
scenarios (Yasuhiro Matsumoto).
closes: #19649
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: 'statuslineopt' is a global only option and configuring the
line height is limited.
Solution: Make 'statuslineopt' global-local to a window and allow to
configure a fixed-height height statusline per window
(Hirohito Higashi).
closes: #19622
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: termdebug :Break does not support `thread` and `if` arguments
Solution: extend :Break and :Tbreak to accept optional location, thread
{nr}, and if {expr} arguments (Yinzuo Jiang).
closes: #19613
Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: :perl ex commands allowed in restricted mode (pyllyukko)
Solution: Add EX_RESTRICT flag to :perldo/:perl command definition.
closes: #19653
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Reading large files is slow because UTF-8 validation and
newline scanning are performed byte-by-byte. Initial file
loading also triggers listener and channel processing.
Solution: Use memchr() for SIMD-optimized newline scanning, implement
word-at-a-time ASCII skipping during UTF-8 validation using a
bitmask, skip listener/netbeans/channel notifications
when the ML_APPEND_NEW flag is set during readfile()
(Yasuhiro Matsumoto).
closes: #19612
Co-authored-by: NRK <nrk@disroot.org>
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Improve the performance of all pythonNumber patterns by unrolling
digit/underscore sequence loops.
- Split the float literal pattern into two simpler patterns.
fixes: #19625 (Reported by James McCoy)
closes: #19630
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: winhighlight option handling can be improved
(after: v9.2.0093)
Solution: Check entire override stack in update_highlight_overrides();
update w_hl of every window in highlight_changed() (Foxe Chen).
closes: #19633
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>