glepnir [Fri, 16 May 2025 17:49:23 +0000 (19:49 +0200)]
patch 9.1.1396: 'errorformat' is a global option
Problem: The 'grepformat' option is global option, but it would be
useful to have it buffer-local, similar to 'errorformat' and
other quickfix related options (Dani Dickstein)
Solution: Add the necessary code to support global-local 'grepformat',
allowing different buffers to parse different grep output
formats (glepnir)
fixes: #17316
closes: #17315
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1395: search_stat not reset when pattern differs in case
Problem: search_stat not reset when pattern differs in case
(tahzibijafar)
Solution: use STRNCMP instead of MB_STRNICMP macro
There was a long standing todo comment, that using MB_STRNICMP is wrong.
So let's change it to STRNCMP() instead. Even if it not handle
multi-byte characters correctly, then Vim will rather recompute the
search stat, instead of re-using the old (and possibly wrong) value.
Sean Dewar [Thu, 15 May 2025 17:59:37 +0000 (19:59 +0200)]
patch 9.1.1393: missing test for switching buffers and reusing curbuf
Problem: The check in buf_freeall that restores curwin subtly prevents
leaving an unloaded buffer in a window when reusing curbuf, if
autocommands switch to a different buffer.
Solution: Add a test case that covers this. Also ensure splitting isn't
possible, as that could do the same (Sean Dewar)
closes: #17325
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
glepnir [Wed, 14 May 2025 18:26:19 +0000 (20:26 +0200)]
patch 9.1.1389: completion: still some issue when 'isexpand' contains a space
Problem: Cannot get completion startcol when space is not the first
trigger character (after v9.1.1383)
Solution: Detect the next comma followed by a space in the option string
and use in next compare loop (glepnir)
closes: #17311
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Luuk van Baal [Wed, 14 May 2025 18:21:55 +0000 (20:21 +0200)]
patch 9.1.1388: Scrolling one line too far with 'nosmoothscroll' page scrolling
Problem: One-off error in "count" to make "w_skipcol" zero with
'nosmoothscroll' page scrolling when last virtual line
in a buffer line is exactly the entire window width.
(Hirohito Higashi)
Solution: Properly compute the smallest integer value necessary
to make "w_skipcol" zero (Luuk van Baal)
fixes: #17317
closes: #17318
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Sean Dewar [Wed, 14 May 2025 18:16:52 +0000 (20:16 +0200)]
patch 9.1.1387: memory leak when buflist_new() fails to reuse curbuf
Problem: buflist_new() leaks ffname and fails to reuse curbuf when
autocommands from buf_freeall change curbuf. Plus, a new
buffer is not allocated in this case, despite what the comment
above claims.
Solution: Remove the condition so ffname is not leaked and so a new
buffer is allocated like before v8.2.4791. It should not be
possible for undo_ftplugin or buf_freeall autocommands to
delete the buffer as they set b_locked, but to stay consistent
with other uses of buf_freeall, guard against that anyway
(Sean Dewar).
Note that buf is set to NULL if it was deleted to guard against the (rare)
possibility of messing up the "buf != curbuf" condition below if a new buffer
happens to be allocated at the same address.
closes: #17319
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1386: MS-Windows: some minor problems building on AARCH64
Problem: MS-Windows: some minor problems building on AARCH64
Solution: Update Make_cyg_ming with aarch64 specific changes,
document how to build on aarch64 using msys2 packages
Luuk van Baal [Mon, 12 May 2025 18:45:41 +0000 (20:45 +0200)]
patch 9.1.1385: inefficient loop for 'nosmoothscroll' scrolling
Problem: Loop that ensures "w_skipcol" is zero with 'nosmoothscroll'
for (half)-page scrolling is inefficient.
Solution: Calculate the required "count" instead of looping until
"w_skipcol" is zero (Luuk van Baal).
fixes: #17301
closes: #17306
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Phạm Bình An [Mon, 12 May 2025 18:39:24 +0000 (20:39 +0200)]
patch 9.1.1384: still some problem with the new tutors filetype plugin
Problem: still some problem with the new tutors filetype plugin
Solution: refactor code to enable/disable tutor mode into
tutor#EnableInteractive() function, include a test
(Phạm Bình An)
I find it annoying that Tutor's interactive mode is always on (or debug
mode is off) even when I open a tutor file with :edit command.
I think it makes more sense to make this "interactive mode":
- Always on when it is opened with :Tutor command
- Off otherwise
For more references, see `:help` feature, it is a much better than
:Tutor, since I don't have to run `:let g:help_debug = 1` just to be able
to edit and save a help file
Therefore, I remove `g:tutor_debug`
closes: #17299
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
glepnir [Mon, 12 May 2025 18:28:28 +0000 (20:28 +0200)]
patch 9.1.1383: completion: 'isexpand' option does not handle space char correct
Problem: When a space character is used as a trigger in 'isexpand' option
it doesn't get recognized because skip_to_option_part() skips
spaces after a comma, treating them as option separators
rather than option value (after v9.1.1341)
Solution: manually set the part to a space character (glepnir).
closes: #17305
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The CheckVimScriptURL() function does not work properly on
pwershell. Most likely this is because curl is aliased to
Invoke-WebRequest on Powershell and redirection seems to work
slightly different
Solution: Disable CheckVimScriptURL() on Powershell and then simplify
the curl download logic
glepnir [Sun, 11 May 2025 11:48:33 +0000 (13:48 +0200)]
patch 9.1.1381: completion: cannot return to original text
Problem: Cannot return to the original text after selecting the next
item when the currently selected item is the last one.
Solution: When continuing to move down past the last item, locate the
original completion at the head/tail nodes of the completed
linked list (glepnir).
closes: #17300
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Sean Dewar [Sun, 11 May 2025 11:45:21 +0000 (13:45 +0200)]
patch 9.1.1380: 'eventignorewin' only checked for current buffer
Problem: When an autocommand executes for a non-current buffer,
'eventignorewin' is only checked from the buffer's last
wininfo (overwrites win_ignore in the loop), not from the
value of 'eventignorewin' in all windows showing the buffer as
described (after v9.1.1084)
Solution: Fix the check and don't use wininfo, as that may only contain
windows that recently showed the buffer. Consider all the
buffer's windows in all tabpages (Sean Dewar).
closes: #17294
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Aliaksei Budavei [Sat, 10 May 2025 19:44:07 +0000 (21:44 +0200)]
runtime(java): Search type and method declarations with "&inc" and "&def"
=============== LIMITATIONS AND OBSERVATIONS ===============
* Remember that external-type names can only be found when
they match filenames resolvable in "&path" with "import"
declarations; load the source file of an external type to
look up its nested types and sibling top types, if any.
* Strive to narrow the search by assigning only relevant
pathnames for directories *or* an archive to "&path", e.g.
":set path-=/usr/include".
* Use "{Visual}gf" on fully-qualified names.
* Accept the fact that "&define" cannot contain end-of-line
characters (":help definition-search"). A declaration
whose matchable header is not contained within a line can
be found iff all of its non-optional components belong to
the same line; for types, such components are a keyword,
e.g. "class", followed by a run of blank characters and
an identifier, e.g. "Test"; for methods: a return type,
e.g. "String", or a keyword "void", followed by a run of
blank characters and an identifier, e.g. "toString", that
is followed by "(".
* The members of the "java.lang" package are usually not
associated with "import" declarations; to look up their
declarations, load a source file for a member of that
package, and then use, on a simple name of interest for
a member, either "[-Ctrl-d" etc. for local declarations
or "gf" for external declarations, assuming that "." *or*
the appropriate pathname for a JDK archive is assigned to
"&path".
* Follow the above instruction made for the "java.lang"
members for any type whose simple name is not associated
with an "import" declaration, i.e. a member type of the
same package that is declared in another compilation unit.
* Append the "$" character to "&iskeyword" when looking up
declarations of generated code.
Aliaksei Budavei [Sat, 10 May 2025 19:40:41 +0000 (21:40 +0200)]
runtime(html): Optionally fold tags with the "expr" method
Tag folding poses a few difficulties. Many elements, e.g.
"blockquote", are always delimited by start and end tags;
end tags for some elements, e.g. "p", can be omitted in
certain contexts; void elements, e.g. "hr", have no end tag.
Although the rules for supporting omissible end tags are
ad-hoc and involved, they apply to elements in scope.
Assuming syntactical wellformedness, an end tag can be
associated with its nearest matching start tag discoverable
in scope and towards the beginning of a file, whereas all
unbalanced tags and inlined tags can be disregarded.
(HTML comments here, "<!-- ... -->", record two values for
each folded line that are separated by ":", a value obtained
from "&foldexpr" and a value obtained from "foldlevel()".)
No folding will be requested for the "<code>"-"</code>" tag
pair and reflected by "&foldexpr" because such a fold would
have claimed the same lines that the immediate fold of the
"<pre>"-"</pre>" tag already claims.
"&foldexpr" values will not be used as is for the lines
between (and including) "[CODE SNIPPET #2]" and "</div>".
(Cf. v9.1.0002.)
Having syntax highlighting in effect, tag folding using the
"fold-expr" method can be enabled with:
------------------------------------------------------------
let g:html_expr_folding = 1
------------------------------------------------------------
By default, tag folding will be redone from scratch after
each occurrence of a TextChanged or an InsertLeave event.
Such frequency may not be desired, especially for large
files, and this recomputation can be disabled with:
------------------------------------------------------------
let g:html_expr_folding_without_recomputation = 1
doautocmd FileType
------------------------------------------------------------
To force another recomputation, do:
------------------------------------------------------------
unlet! b:foldsmap
normal zx
------------------------------------------------------------
Phạm Bình An [Sat, 10 May 2025 19:20:57 +0000 (21:20 +0200)]
runtime(tutor): improve tutor.vim plugin and filetype plugin
- Set g:tutor_debug on startup if it doesn't exist so that users can get
cmdline completion when interactively setting it.
- set b:undo_ftplugin in filetype plugin
- set default runtime file headers
closes: #17274
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
GuyBrush [Sat, 10 May 2025 18:44:33 +0000 (20:44 +0200)]
patch 9.1.1379: MS-Windows: error when running evim when space in path
Problem: MS-Windows: error when running evim when space in path of Vim
Solution: properly parse quoted strings (Miguel Barro)
When vim is installed in a path with whitespaces (like
`C:\Program Files (x86)\Vim\vim91\vim.exe`). Launching `evim` or
`vim -d` will try to open the file ` (x86)\Vim\vim91\vim.exe`.
Modern versions of vim simplify shell operation by parsing its own
command line. For example on Linux all vim flavours like `evim`, `rvim`,
etc are symlinks to vim. Then vim uses the `parse_command_name()`
function to identify which version of vim it should launch.
For `evim` if a GUI is available `gvim` is launched for better user
experience. In order to launch `gvim` the original command line is
parsed to be passed *verbatim* to the new instance.
This parsing did not properly handle quoted command lines with
whitespaces such as
```
"C:\Program Files (x86)\Vim\vim91\vim.exe" -y myfile.txt
```
closes: #17295
Signed-off-by: Miguel Barro <miguel.barro@live.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
glepnir [Sat, 10 May 2025 12:59:08 +0000 (14:59 +0200)]
patch 9.1.1378: sign without text overwrites number option
Problem: When 'signcolumn' is set to `number` but a line has a sign
without text, the line number disappears (finite-state-machine)
Solution: Verify that a sign actually contains text before rendering the
line number (glepnir)
fixes: #17169
closes: #17282
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Drew Vogel [Sat, 10 May 2025 12:46:28 +0000 (14:46 +0200)]
patch 9.1.1377: patch v9.1.1370 causes some GTK warning messages
Problem: Some GTK3 users experienced unexpectedly small windows at
startup (after v9.1.1368, @berggeist, Tony Mechelynck)
Solution: Update window manager hints in gui_mch_open, partly revert
v9.1.1370 (Drew Vogel)
fixes: #17279
closes: #17288
Signed-off-by: Drew Vogel <dvogel@github> Signed-off-by: Christian Brabandt <cb@256bit.org>
Andis Spriņķis [Sat, 10 May 2025 12:42:25 +0000 (14:42 +0200)]
runtime(lf): use syn iskeyword in syntax script
Sets 'syn iskeyword' in syntax/lf.vim to fix the missing lf keyword
highlighting in lines like 'map e :open; open' (first 'open' not
highlighted).
applies PR andis-sprinkis/lf-vim#21 by @joelim-work
closes: andis-sprinkis/lf-vim#14
Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com> Signed-off-by: Andis Spriņķis <andis@sprinkis.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Sean Dewar [Sat, 10 May 2025 12:33:28 +0000 (14:33 +0200)]
patch 9.1.1376: quickfix dummy buffer may remain as dummy buffer
Problem: when failing to wipeout a quickfix dummy buffer, it will
remain as a dummy buffer, despite being kept.
Solution: clear its dummy BF_DUMMY flag in this case (Sean Dewar).
closes: #17283
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Sean Dewar [Sat, 10 May 2025 12:30:36 +0000 (14:30 +0200)]
patch 9.1.1375: [security]: possible heap UAF with quickfix dummy buffer
Problem: heap use-after-free possible when autocommands switch away from the
quickfix dummy buffer, but leave it open in a window.
Solution: close its windows first before attempting the wipe.
(Sean Dewar)
related: #17283
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Girish Palya [Thu, 8 May 2025 21:28:52 +0000 (23:28 +0200)]
patch 9.1.1374: completion: 'smartcase' not respected when filtering matches
Problem: Currently, 'smartcase' is respected when completing keywords
using <C-N>, <C-P>, <C-X><C-N>, and <C-X><C-P>. However, when
a user continues typing and the completion menu is filtered
using cached matches, 'smartcase' is not applied. This leads
to poor-quality or irrelevant completion suggestions, as shown
in the example below.
Solution: When filtering cached completion items after typing additional
characters, apply case-sensitive comparison if 'smartcase' is
enabled and the typed pattern includes uppercase characters.
This ensures consistent and expected completion behavior.
(Girish Palya)
closes: #17271
Signed-off-by: Girish Palya <girishji@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
glepnir [Thu, 8 May 2025 21:05:10 +0000 (23:05 +0200)]
patch 9.1.1373: 'completeopt' checking logic can be simplified
Problem: Flag checking logic uses a temporary variable and multiple
bitwise operations in insexpand.c
Solution: Consolidate into a single equality check using bitwise OR and
comparison (glepnir)
closes: #17276
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Drew Vogel [Wed, 7 May 2025 20:05:17 +0000 (22:05 +0200)]
patch 9.1.1370: CI Tests favor GTK2 over GTK3
Problem: CI Tests favor GTK2 over GTK3
Solution: Install GTK3 dependencies and debug packages for CI workflows,
update ASAN suppression list, update required dependency
checks for the tests (Drew Vogel)
closes: #17253
Signed-off-by: Drew Vogel <dvogel@github> Signed-off-by: Christian Brabandt <cb@256bit.org>
John Marriott [Wed, 7 May 2025 17:59:42 +0000 (19:59 +0200)]
patch 9.1.1367: too many strlen() calls in gui.c
Problem: too many strlen() calls in gui.c
Solution: refactor gui.c slightly (John Marriott)
This does the following changes:
- use macro STRCMP() instead of strcmp().
- refactor gui_outstr_nowrap() to remove call to STRLEN().
- refactor get_tabline_label() in attempt to simply it. At the same time
use standard looping construct for iterating over windows in a tab.
Move variables closer to where they are used. Add check that we don't
exceed size of NameBuff.
- small optimisation in get_find_dialog_text() to measure the string
length once.
closes: #17269
Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
Phạm Bình An [Tue, 6 May 2025 16:08:38 +0000 (18:08 +0200)]
runtime(lua): update 'path' option in filetype plugin
Problem: Lua doesn't support importing module in path related to current
file like JS does (https://www.reddit.com/r/lua/comments/wi0bau/whats_the_correct_way_to_run_a_lua_file_that_uses/)
Solution: Remove `.` from Lua buffer-local option `'path'`
closes: #17267
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Peter Kenny [Mon, 5 May 2025 18:15:39 +0000 (20:15 +0200)]
runtime(helptoc): the helptoc package can be improved
Adds the following changes:
- New Maintainer: Pete Kenny
- New filetypes supported (asciidoc, html, tex, vim, xhtml)
- improved Markdown support
- Sanitised ToCs and popup presentation
- Configuration improvements and options
- Add helptoc.txt help file
closes: #17255
Signed-off-by: Peter Kenny <github.com@k1w1.cyou> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1362: Vim9: type ignored when adding tuple to instance list var
Problem: Vim9: type ignored when adding tuple to instance list var
(Lifepillar)
Solution: When getting the typval of class and object member variables,
set the variable type (Yegappan Lakshmanan)
fixes: #17236
closes: #17244
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Sean Dewar [Sat, 3 May 2025 16:37:27 +0000 (18:37 +0200)]
patch 9.1.1361: [security]: possible use-after-free when closing a buffer
Problem: [security]: Possible to open more windows into a closing
buffer without splitting, bypassing existing "b_locked_split"
checks and triggering use-after-free
Solution: Disallow switching to a closing buffer. Editing a closing
buffer (via ":edit", etc.) was fixed in v9.1.0764, but add an
error message and check just "b_locked_split", as "b_locked"
is necessary only when the buffer shouldn't be wiped, and may
be set for buffers that are in-use but not actually closing.
(Sean Dewar)
closes: #17246
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
zeertzjq [Fri, 2 May 2025 13:35:58 +0000 (15:35 +0200)]
patch 9.1.1360: filetype: GNU Radio companion files are not recognized
Problem: filetype: GNU Radio companion files are not recognized
Solution: detect *.grc files as xml or yaml filetype depending on the
first line (zeertzjq).
zeertzjq [Fri, 2 May 2025 13:32:23 +0000 (15:32 +0200)]
patch 9.1.1359: filetype: GNU Radio config files are not recognized
Problem: filetype: GNU Radio config files are not recognized.
Solution: detect GNU Radio config files as confini filetype. Only
allow '#' as start of comment in confini syntax (zeertzjq).
Phạm Bình An [Thu, 1 May 2025 15:40:15 +0000 (17:40 +0200)]
runtime(doc): update example ctags program and links
- :helptags is also a tags generating program, it deserves mentioning
- JTags seems too dead: its website has been sold, the source, binary
can't be found anywhere.
- update link of ptags
closes: #17233
Signed-off-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Phạm Bình An [Thu, 1 May 2025 15:30:58 +0000 (17:30 +0200)]
patch 9.1.1357: Vim incorrectly escapes tags with "[" in a help buffer
Problem: Vim incorrectly escapes tags containing "[" in a help buffer
Solution: check if the buffer has the "help" filetype set, instead of
already being a help buffer (Phạm Bình An)
fixes: #17224
closes: #17232
Co-authored-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1355: The pum_redraw() function is too complex
Problem: The pum_redraw function is too complex and difficult to
maintain with nested loops and mixed responsibilities handling
both RTL and LTR text rendering.
Solution: Extracted core rendering logic into dedicated helper functions
(pum_display_rtl_text, pum_display_ltr_text, pum_draw_scrollbar,
pum_process_item) while preserving the original behavior. This
improves code readability and maintainability (glepnir).
closes: #17204
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1354: tests: Test_terminalwinscroll_topline() fails on Windows
Problem: tests: Test_terminalwinscroll_topline() fails on Windows
(after v9.1.1348)
Solution: instead of disabling it in Github Actions runners, disable it
for all Windows runs
patch 9.1.1351: Return value of getcmdline() inconsistent in CmdlineLeavePre
Problem: Return value of getcmdline() inconsistent in CmdlineLeavePre
when leaving cmdline in different ways (after v9.1.1329).
Solution: Trigger CmdlineLeavePre before calling abandon_cmdline() so
that getcmdline() can return the command line (zeertzjq).
runtime(java): Consent to HTML tags folding in Javadoc comments
HTML tags in Javadoc comments can additionally be folded
after applying
------------------------------------------------------------
let g:html_syntax_folding = 1
set foldmethod=syntax
------------------------------------------------------------
and giving explicit consent with
------------------------------------------------------------
let g:java_consent_to_html_syntax_folding = 1
------------------------------------------------------------
Do not default to this kind of folding unless ALL start tags
and optional end tags are balanced in Javadoc comments;
otherwise, put up with creating runaway folds that break
syntax highlighting.
resolves: zzzyxwvut/java-vim#8.
closes: #17216
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: CmdlineLeavePre may trigger twice
(after v9.1.1329)
Solution: check that the key was typed, trigger it when it wasn't before
(Girish Palya)
There are two problems:
- CmdlineLeavePre may be triggered twice when a cabbr is present.
- CmdlineLeavePre fails to trigger when exiting the command-line via
<Backspace>.
Check if the Carriage Return (Enter) key was actually typed.
Trigger the event when the command-line is exited using Backspace and
other keys.
closes: #17214
Signed-off-by: Girish Palya <girishji@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit contains the following changes:
- Fixes Warning 1:
The prototype of `GetMenuState()` says that it returns a UINT, but
returns -1 on failure. Huh?!?
Also, Microsoft says that this function has been superseded (see
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmenustate)
and replaced by `GetMenuItemInfo()`. Both of these functions have a
minimum support of Windows 2000.
Therefore in `_OnMenuSelect()`, replace the call to `GetMenuState()`
with `GetMenuItemInfo()`.
- Fixes Warning 2:
Add `UNUSED` to the definition of `_OnGetDpiScaledSize()`.
- Simplify `logfont2name()`.
- Add small optimisations in `_OnNotify()` and `gui_mch_do_spawn()`.
- Add out-of-memory check in `gui_mch_do_spawn()`.
- Code cosmetics (see definitions of `process_message_usual_key_classic()`
and `process_message()`).
closes: #17208
Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime(doc): clarify complete_match() and 'isexpand' option
clarify complete_match() documentation to better explain its backward
search behavior, argument handling, and return value format and add an
example of isexpand
closes: #17212
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
John Marriott [Fri, 25 Apr 2025 17:14:38 +0000 (19:14 +0200)]
patch 9.1.1346: missing out-of-memory check in textformat.c
Problem: missing out-of-memory check in textformat.c
Solution: add out-of-memory check, add small optimizations to
internal_format() and same_leader() (John Marriott)
closes: #17200
Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1345: tests: Test_xxd_color2() test failure dump diff is misleading
Problem: tests: Test_xxd_color2() test failure dump diff is misleading
Solution: Ensure the reference dump and the test dump are both processed the
same (Drew Vogel).
Background:
Commit b6dc76b6fd23e571d309064b795847ee9ffc7689 sought to make the xxd
screendump tests compatible with non-standard `XXD` overrides. It provides a
vim script that matches a very general `xxd` command pattern but then also
removed the matching line from the reference dump. This second step was
unnecessary because `VerifyScreenDump()` runs the associated vim script against
both the reference dump and the test dump.
Problem Details:
As part of some unrelated work, the GUI tests were failing with a window size 1
column too narrow. The screendumps in `Test_xxd_color2` were failing as a
result. When I loaded the diff using `term_dumpdiff()` the associated vim
scripts are not run. As a result, the test dump contained the `xxd` invocation
on line 1 while reference dump did not. This throws the diff off, obscuring the
true issue of the GUI window being too narrow.
Verification:
In addition to the test suite, locally I've tried to recreate the issue being
fixed in b6dc76b6fd23e571d309064b795847ee9ffc7689. Setting a very non-standard
`XXD` path, this test still passes:
```
XXD=/home/dvogel/opt/vim/bin/xxd TEST_FILTER=Test_xxd_color2 TERM=xterm-color make test_xxd
rm -f test_xxd.res test.log messages starttime
if test -n "${ASAN_OPTIONS}"; then \
XXD=../xxd/xxd; export XXD; ASAN_OPTIONS="${ASAN_OPTIONS}_test_xxd" \
UBSAN_OPTIONS="${UBSAN_OPTIONS}_test_xxd" VIMRUNTIME=../../runtime ../vim -f \
-u unix.vim --gui-dialog-file guidialog -U NONE --noplugin --not-a-term -S \
runtest.vim test_xxd.vim ; \
fi
From test_xxd.vim:
Executed Test_xxd_color2() in 0.066049 seconds
Filtered 17 tests with $TEST_FILTER and $TEST_SKIP_PAT
Executed 1 test in 0.096862 seconds
```
closes: #17202
Signed-off-by: Drew Vogel <dvogel@github> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1344: double free in f_complete_match() (after v9.1.1341)
Problem: double free in f_complete_match() (after v9.1.1341)
Solution: remove additional free of trig pointer, correctly free
regmatch.regprog and before_cursor in the error case
closes: #17203
Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1342: Shebang filetype detection can be improved
Problem: Shebang filetype detection can be improved
Solution: Improve detection logic (Eisuke Kawashima)
Vim does not correctly detect filetype from
- `#!/usr/bin/env --split-string=awk -f`
- `#!/usr/bin/env -S -i awk -f`
- `#!/usr/bin/env -S VAR= awk -f`
So update the current detection logic to detect those cases.
closes: #17199
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>