patch 9.1.1734: Memory leak when allocating match fails
Problem: Memory leak when allocating match fails
Solution: Initialize m to NULL and centralize cleanup via goto fail to
avoid leaks on early returns (Damien Lejay)
Martin Schwan [Thu, 4 Sep 2025 20:09:26 +0000 (22:09 +0200)]
patch 9.1.1732: filetype: .inc file detection can be improved
Problem: filetype: .inc file detection can be improved
Solution: Update filetype detection for Pascal and BitBake code
(Martin Schwan).
Fix the detection of .inc files containing Pascal and BitBake code:
- the concatenated string, merged from three lines, only contains one
beginning and the pattern "^" would not match as expected. Use a range()
loop to iterate each line string individually. This way, the pattern "^"
works for beginning of lines.
- improve BitBake include file detection by also matching forward-slashes
"/" in variable names and assignment operators with a dot ".=" and "=.".
Valid examples, which should match, are:
This change does the following to the M4 syntax script:
- In M4 there are no "strings" in the usual sense. Instead, M4 has
quotes, but the text inside a quoted region is rescanned just like
outside, and quotes can be nested.
- The old m4String region was misleading and removed. A new m4Quoted
region reflects proper quoting semantics.
- Removed a duplicate highlight rule.
- Fixed a typo in a highlight group name (m4builtin → m4Builtin).
- Added a reference link to the POSIX M4 specification.
- Removed outdated maintainer URL.
closes: #18192
Signed-off-by: Damien Lejay <damien@lejay.be> Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Wayland code can be improved
Solution: Refactor Wayland Clipboard code (Foxe Chen)
This refactor makes the Wayland codebase less convoluted:
- Move clipboard code in wayland.c to clipboard.c
- Use C99 bool type
- Properly poll the Wayland display file descriptor
- Instead of checking if the data source is not NULL in order to
determine if a selection event comes from us, use a special mime type to
identify selection events coming from ourselves. The problem with the
previous approach is that race conditions may occur.
- Put the focus stealing code under a new feature "wayland_focus_steal"
- Use ELAPSED_* macros instead of gettimeofday()
- Pass tests
- Reimplement commented out code
- Update docs
- Make Wayland clipboard behaviour more in line with X11 when connection is lost
- add missing malloc checks and possible memory leaks + refactored some
tests.
closes: #18139
Signed-off-by: Foxe Chen <chen.foxe@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
ashamedbit [Sun, 31 Aug 2025 18:05:23 +0000 (20:05 +0200)]
patch 9.1.1722: compiler may optimize away clearing of crypt key
Problem: Compiler may optimize away clearing of crypt key
Solution: Use sodium_memzero() if available, else use memset() using a
volatile function pointer (ashamedbit).
closes: #18173
Signed-off-by: ashamedbit <muralianiruddhan@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Hirohito Higashi [Sun, 31 Aug 2025 17:43:23 +0000 (19:43 +0200)]
patch 9.1.1721: Defining a global gettimeofday() function
Problem: Defining a global gettimeofday() function causes conflicts if
gettimeofday() is already defined.
Solution: Revert globalized gettimeofday() function (Hirohito Higashi).
Aliaksei Budavei [Sun, 31 Aug 2025 17:16:14 +0000 (19:16 +0200)]
runtime(java): Dismiss "g:markdown_fenced_languages" for Java buffers
No support is provided or planned for language recognition
in code snippets of documentation comments. Requesting to
load arbitrary syntax plugins with the aid of the concerned
variable is therefore wasteful in general and erroneous when
paired languages ":syn-include" one another without taking
steps to manage circularity.
related: #17308
related: #17220
closes: #18172
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Hirohito Higashi [Sun, 31 Aug 2025 16:52:32 +0000 (18:52 +0200)]
patch 9.1.1715: Some functions need to be re-ordered
Problem: Some functions need to be re-ordered
Solution: Re-order and move functions around favoring mch_*() functions
inside os_*.c files, Change scope of dos_expandpath() to
global instead of static (Hirohito Higashi)
The following fixes and tweaks have been made:
- Moved the definition of mch_expandpath() from filepath.c to os_win32.c
in MS-Windows builds (essentially, the mch_~() function should be
defined in os_~.c.)
- In accordance with the above, the scope of dos_expandpath() has been
changed from static to global.
- Other miscellaneous changes.
closes: #18176
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1708: tests: various tests can be improved
Problem: tests: various tests can be improved
Solution: Use string interpolation to concatenate strings in
test_winfixbuf, check for specific errors in assert_fails()
(Yegappan Lakshmanan)
closes: #18151
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Foxe Chen [Wed, 27 Aug 2025 21:53:41 +0000 (23:53 +0200)]
patch 9.1.1706: MS-Windows: Compile error when building with if_ruby
Problem: MS-Windows: Compile error when building with if_ruby
(Christian Robinson, after v9.1.1704)
Solution: Do not define gettimeofday() if ruby interface is compiled in
(Foxe Chen).
fixes: #18143
closes: #18144
Signed-off-by: Foxe Chen <chen.foxe@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Damien Lejay [Wed, 27 Aug 2025 19:31:35 +0000 (21:31 +0200)]
patch 9.1.1705: time.h include is available on all platforms
Problem: time.h include is available on all platforms
Solution: Remove ifdef guards and simply include it in all source files,
get rid of double include in spellfile.c (Damien Lejay).
closes: #18075
Signed-off-by: Damien Lejay <damien@lejay.be> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1701: tests: failure on CI with GUI and ASAN in test_edit.res
Problem: tests: failure on CI with GUI and ASAN in test_edit.res
(Hirohito Higashi)
Solution: Disable the test for that specific situation in CI, close
swapfiles
patch 9.1.1700: Multiline ignorecase specific pattern does not match with 'ignorecase'
Problem: a pattern that involves a backref on a different line does not
match when 'ignorecase' is set (QiWei, after v9.1.0645)
Solution: Use MB_STRNICMP when ignorecase is set, fix tests to close
swapfiles
related: #14756
fixes: #17470
closes: #18104
Signed-off-by: author Signed-off-by: Christian Brabandt <cb@256bit.org>
Maxim Kim [Wed, 27 Aug 2025 16:09:14 +0000 (18:09 +0200)]
patch 9.1.1699: Fuzzy completion disabled for 'findfunc' and customlist
Problem: Fuzzy completion disabled for 'findfunc' and customlist
Solution: Remove those cases from cmdline_fuzzy_completion_supported()
because it is supported (Maxim Kim).
fixes: #18117
closes: #18122
Signed-off-by: Maxim Kim <habamax@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Sean Dewar [Tue, 26 Aug 2025 19:45:07 +0000 (21:45 +0200)]
patch 9.1.1696: tabnr from getwininfo() for popup windows is always 0
Problem: getwininfo() has logic for getting the tabnr of a local popup
window, but due to only breaking from the inner loop, tp is
eventually set to NULL, so tabnr is always 0.
Solution: Break out of both loops, continue to use 0 for global popup
windows (Sean Dewar).
closes: #18111
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1693: tests: test_filetype fails in shadow dir
Problem: tests: test_filetype fails in shadow dir
(after v9.1.9.1.1687)
Solution: Use a custom test that does not rely on configure.ac
being existing in the upper directory tree.
Damien Lejay [Tue, 26 Aug 2025 15:55:14 +0000 (17:55 +0200)]
patch 9.1.1691: over-allocation in ga_concat_strings()
Problem: over-allocation in ga_concat_strings()
Solution: Fix ga_concat_strings() and only allocate n-1 separator length
bytes (Damien Lejay).
ga_concat_strings() was adding the separator length for every item,
including the last one. Only (n - 1) separators are actually used.
This caused harmless but unnecessary overallocation.
closes: #18112
Signed-off-by: Damien Lejay <damien@lejay.be> Signed-off-by: Christian Brabandt <cb@256bit.org>
John Marriott [Tue, 26 Aug 2025 15:32:18 +0000 (17:32 +0200)]
patch 9.1.1688: potential buffer overrun in bufwrite.c
Problem: potential buffer overrun in bufwrite.c
Solution: Use a temporary variable (John Marriott)
In my Windows 11 Pro 64-bit build MAXPATHL is 1024 and IOSIZE is 1025.
In my Archlinux Linux 64-bit build MAXPATHL is 4096 and IOSIZE is 1025.
In funuction buf_write():
There is a check (line 713) that makes sure the length of fname is less
than MAXPATHL. There is a call to STRCPY() (line 1208) which copies the
string at fname into IObuff (which has size IOSIZE). For Unix builds
fname is set to sfname which may or may not be shorter. However, if
sfname is NULL sfname is set to fname.
Therefore, in builds where MAXPATHL > IOSIZE (eg in my linux build), it
is theoretically possible for the STRCPY() call to exceed the bounds of
IObuff.
This PR addresses this by copying fname into a local variable that has
the same maximum size as fname.
In addition:
Given that the filename is unconditionally overwritten in the for loop,
only copy the directory portion of fname. Move variable i closer to
where it is used.
closes: #18095
Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
Damien Lejay [Tue, 26 Aug 2025 15:09:47 +0000 (17:09 +0200)]
patch 9.1.1687: filetype: autoconf filetype not always correct
Problem: filetype: autoconf filetype not always correct
Solution: Detect aclocal.m4 as config filetype, detect configure.ac as
config filetype, fall back to POSIX m4 (Damien Lejay).
closes: #18065
Signed-off-by: Damien Lejay <damien@lejay.be> Signed-off-by: Christian Brabandt <cb@256bit.org>
Jon Parise [Sun, 24 Aug 2025 10:31:08 +0000 (12:31 +0200)]
runtime(python): support 'type's soft keyword form
`type` became a soft keyword in Python 3.12. In that form, it is a
statement that declares a type alias:
# type_stmt ::= 'type' identifier [type_params] "=" expression
type Point = tuple[float, float]
To implement support for this, this change does three things:
1. adds a `pythonType` group (linked to `Type`)
2. matches `type` followed by an identifier as `pythonStatement`
3. continues to match `type` in other forms as `pythonBuiltin`
Problem: tests: Test_wildtrigger_update_screen() creates an unused
mapping (after 9.1.1621).
Solution: Remove the mapping. Also use blank lines more consistently in
test_cmdline.vim screendump tests (zeertzjq).
closes: #18096
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
zeertzjq [Sun, 24 Aug 2025 10:22:10 +0000 (12:22 +0200)]
patch 9.1.1681: tests: no test for actually moving cursor with 'acl'
Problem: tests: no test for actually moving cursor when menu is not
open with 'autocompletedelay'.
Solution: Use <Up> first in the test. Also remove two unnecessary <Esc>s
in completion timeout test (zeertzjq).
closes: #18097
Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
patch 9.1.1680: MS-Windows: possible buffer-under run in if_cscope
Problem: MS-Windows: possible buffer-under run in if_cscope
cs_pathcomponents() (Murali Aniruddhan)
Solution: Fix the loop and do not decrement the pointer twice.
Jason Long [Sat, 23 Aug 2025 15:44:32 +0000 (17:44 +0200)]
runtime(netrw): fix :Explore command in terminal
There are really two issues solved here:
- The directory listing was not populating the new buffer when using
the :Explore command. This was because the directory to open is
determined by using expand("%:p") which includes '!/running/command' at
the end of the string in terminal buffers.
- The :Explore command should replace the buffer, not split it. This
because the Explore command will automatically split if the current
buffer has been modified. According to the docs, all terminal buffers
will have the modified flag set when a job is running.
Damien Lejay [Sat, 23 Aug 2025 15:37:12 +0000 (17:37 +0200)]
patch 9.1.1678: Amiga: cannot handle large undo files
Problem: Amiga: cannot handle large undo files
Solution: Remove the existing restriction as it was only valid for
classic Amiga (Damien Lejay).
It seems that this block was only relevant for classic AmigaOS (< 32K
alloc limit). And it seems to no longer apply: AmigaOS 4.0 switched to
a slab allocator memory system.
closes: #18072
Signed-off-by: Damien Lejay <damien@lejay.be> Signed-off-by: Christian Brabandt <cb@256bit.org>