Problem: popup: flickering on opaque popups with overlapping text,
even if they are opaque (after v9.2.0016).
Solution: Prevent double redrawing by skipping background updates for
opaque popups. Revert changes to test dumps
(Javier Jaramago Fernández).
A flickering effect was introduced in commit v9.2.0016 (commit:
6c203072f) for all popups. This is a consequence of a double redraw of
the overlapping background characters. This could be expected for
transparent popups, but, it should exclude opaque ones. For a complete
fix of the flickering this commit is required in combination with fix
present in v9.2.0064 (commit: 97c5bed84b).
Additionally this commit reverts changes introduced for tests dumps for
masks in commits 6c203072f and cded5e220. These dumps were updated
preventing characters from popups to take into account the masks
specified for them. This forces the redraw of popup characters, even
when masks attempt to prevent them, leading to flickering effects. See
issues #19510 and PR: #19534.
closes: #19534
Signed-off-by: Javier Jaramago Fernández <jaramago.fernandez.javier@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: 'listchars' "leadtab" not used in :list (after 9.2.0088).
Solution: Also check for "leadtab" when using :list. Fix memory leak on
E1572 if "multispace" or "leadmultispace" is set (zeertzjq).
closes: #19557
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: A recent commit introduced a new function named
`update_highlight_overrides()` in `highlight.pro` and
`highlight.c`, one of the parameter names conflicts with the C++
keyword `new`. This causes compilation issues on Windows when
VIM is compiled with OLE enabled, as "if_ole.cpp" cannot compile
due to the conflict (after v9.2.0093).
Solution: Rename the parameter name of `update_highlight_overrides()`
from new to hl_new (Wei Tang)
fixes: #19568closes: #19558
Signed-off-by: Wei Tang <gauchyler@uestc.edu.cn>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity complains about uninitialized var, also gcc warns
about a few other variables possibly being used uninitialized
(Tony Mechelynck, after v9.2.0093)
Solution: Initialize a few other variables.
Coverity CID: 1683101
closes: #19561
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity: error handling issues in win_init() (after
v9.2.0093)
Solution: Only call pop_highlight_overrides() when
push_highlight_overrides() was successful.
CID: 1683100
related: #19561
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Memory leak in qf_push_dir() (after v9.2.0091)
Problem: free dirname, if it is not a directory.
closes: #19552
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The has() function is slow because it performs a linear scan
of the feature list for every call.
Solution: Move common runtime checks and the patch-version parser to the
beginning of the f_has() function (Yasuhiro Matsumoto).
closes: #19550
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: In XTerm, typing Home, End, PgUp or PgDn on the editing pad
will cause vim to recognize <kHome>, <kEnd>, <kPageUp> or
<kPageDown> (keypad keys) instead of <Home>, <End>, <PageUp>
or <PageDown> (editing pad keys) respectively, affecting
mappings and the :terminal. This is caused because the keypad
termcaps are sorted before the editing pad ones in
termcodes, meaning vim will match the former if they are the
same.
Solution: Only recognize keypad keys when nothing else matches
(AstroSnail).
fixes: #17331closes: #19145
Signed-off-by: AstroSnail <astrosnail@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: In popup windows, concealed characters and tab expansion
may cause wrong truncation for fixed width windows.
Solution: Do not adjust the screen column and bogus column counters
for popup windows when handling concealed text or extra
padding characters (Yasuhiro Matsumoto).
closes: #19121
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Not possible to have window-local highlighting groups
(Hima)
Solution: Port Neovims 'winhighlight' option to Vim (Foxe Chen).
fixes: #3576closes: #19493
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: inside_block() iterates through all cstack levels
and returns TRUE when a CSF_BLOCK frame is found. For control
flow commands this causes '|' to no longer be
recognised as a command separator, breaking
"try | silent cmd | catch | endtry" (Martin Tournoij, after
v9.2.0072).
Solution: Return FALSE from inside_block() for control flow commands
that handle '|' themselves, so they always use '|' as
separator regardless of block nesting.
fixes: #19535closes: #19543
supported by AI claude.
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: "leadtab" behavior inconsistent on line with only TABs
(after 9.2.0088).
Solution: Don't consider those as leading TABs. Also add more tests for
existing behavior of "lead" and "leadmultispace" (zeertzjq).
closes: #19549
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: netrw: does not take port into account in hostname validation
(after v9.2.0073)
Solution: Update hostname validation check and test for an optional port
number (Miguel Barro)
closes: #19533
Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Omit paste capability from the osc52 provider when g:osc52_disable_paste
is enabled This avoids OSC 52 paste queries on unsupported terminals and
prevents the +/* registers from being treated as empty. Documentation
updated accordingly.
related: #18983
closes: #19542
Signed-off-by: mikoto2000 <mikoto2000@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: cannot display tabs for indentation
Solution: Add the "leadtab" value to the 'listchars' option to
distinguish between tabs used for indentation and tabs used
for alignment (HarshK97).
closes: #19094
Signed-off-by: HarshK97 <harshkapse1234@gmail.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: popup: redrawing can be improved when moving popups
Solution: When a pop-up window moves, only the target window should be
redrawn (Yasuhiro Matsumoto).
closes: #19536
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Coverity complains that ScreenLines can be NULL
(after v9.2.0080)
Solution: Remove null test
closes: #19538
CID: 1682067
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_client_server_stopinsert() is flaky.
Solution: Use remote_send() instead of remote_expr().
closes: #19539
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: There is a xkb syntax, but no filetype plugin.
Solution: Create a filetype plugin and set the comment and commentstring
options for the xkb filetype (xkb = X keyboard extension)
closes: #19537
Signed-off-by: GX <59413576+gx089@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Cannot have a mutli-line statusline.
Solution: Add support for multi-line statusline
(Hirohito Higashi).
closes: #19123
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Patch v9.2.0052 was wrong
Solution: Revert it for now
Revert "patch 9.2.0052: Wayland: hiding lower half of command line in tiny vim"
This reverts commit b834c3f23b.
related: #19504
related: #19483
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: When z= fails due to no word being found, 'spelllang' being
unset or a multiline visual selection, 'nospell' is not
restored.
Solution: Jump to where the user configured value of 'spell' is restored
instead of returning early (Luuk van Baal).
closes: #19525
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Popup windows leave ghost images when moved. Visual options
do not trigger a redraw when updated via popup_setoptions().
An empty borderhighlight list fails to clear existing
highlights.
Solution: Modify f_popup_move() in src/popupwin.c to save the old
position before moving and force a redraw. Enhance
f_popup_setoptions() to trigger a redraw when
visual-affecting options change. Modify
apply_general_options() to explicitly clear border
highlights when an empty list is provided
(Yasuhiro Matsumoto).
closes: #19297
Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Attempt to match all variations of group name and comma separator across
continuation lines.
Fixes issues:
- #18491 (Two ")"s are incorrectly colored 'vimOperError' in
syntax/mail.vim), reported by @lkintact
- #19366 (highlight error for contains elements in a new line), reported
by Maxim Kim
fixes: #18491fixes: #19366
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: memory leak in eval_dict()
Solution: Do not return but goto failret (Huihui Huang).
closes: #19531
Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: A stack-buffer-overflow occurs when rendering a statusline
with a multi-byte fill character on a very wide terminal.
The size check in build_stl_str_hl() uses the cell width
rather than the byte length, allowing the subsequent fill
loop to write beyond the 4096-byte MAXPATHL buffer
(ehdgks0627, un3xploitable).
Solution: Update the size check to account for the byte length of
the fill character (using MB_CHAR2LEN).
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-gmqx-prf2-8mwf
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: memline: a crafted swap files with bogus pe_page_count/pe_bnum
values could cause a multi-GB allocation via mf_get(), and
invalid pe_old_lnum/pe_line_count values could cause a SEGV
when passed to readfile() (ehdgks0627, un3xploitable)
Solution: Add bounds checks on pe_page_count and pe_bnum against
mf_blocknr_max before descending into the block tree, and
validate pe_old_lnum >= 1 and pe_line_count > 0 before calling
readfile().
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-r2gw-2x48-jj5p
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: When processing terminal output with many combining characters
from supplementary planes (4-byte UTF-8), a heap-buffer
overflow occurs. Additionally, the loop iterating over
cell characters can read past the end of the vterm array
(ehdgks0627, un3xploitable).
Solution: Use VTERM_MAX_CHARS_PER_CELL * 4 for ga_grow() to ensure
sufficient space. Add a boundary check to the character
loop to prevent index out-of-bounds access.
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-rvj2-jrf9-2phg
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: When parsing a malformed Emacs-style tags file, a 1-byte
heap-buffer-underflow read occurs if the 0x7f delimiter
appears at the very beginning of a line. This happens
because the code attempts to scan backward for a tag
name from the delimiter without checking if space exists.
(ehdgks0627, un3xploitable)
Solution: Add a check to ensure the delimiter (p_7f) is not at the
start of the buffer (lbuf) before attempting to isolate
the tag name.
GitHub Advisory:
https://github.com/vim/vim/security/advisories/GHSA-xcc8-r6c5-hvwv
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: [security]: Insufficient validation of hostname and port in
netrw URIs allows command injection via shell metacharacters
(ehdgks0627, un3xploitable).
Solution: Implement stricter RFC1123 hostname and IP validation.
Use shellescape() for the provided hostname and port.
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-m3xh-9434-g336
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: inside_block() always checks the flags of the top-most stack
entry instead of the current loop index.
Solution: Use the loop index 'i' to check all levels of the condition
stack (Weixie Cui).
closes: #19524
Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: various tests leave swapfiles around
Solution: close open buffers using :bw! instead of :close!
Signed-off-by: Christian Brabandt <cb@256bit.org>
Patch 9.2.0033 (#19260) introduced a dedicated `env` filetype for
.env files, which were previously detected as `sh`. This left env
files without `commentstring`, `comments`, or `formatoptions` since
no ftplugin was added alongside the new filetype.
Add runtime/ftplugin/env.vim to set these options, matching the
behavior that .env files had when they used the `sh` filetype.
closes: #19522
Signed-off-by: snelling-a <72226000+snelling-a@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The length passed to add_attr_and_value for " ctermfont=" is
incorrect. In highlight_set_font(), sg_font_name is freed and
updated in two separate branches, leading to redundant code.
Solution: Correct the length parameter in hlg_add_or_update().
Refactor highlight_set_font() to update the font name string
only once after a successful change is detected.
closes: #19512
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Inefficient use of list_append_string()
Solution: Pass string length to list_append_string() where it is known
(John Marriott).
closes: #19491
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>