Problem: MS-Windows: crash when passing long string to expand() with
'wildignorecase'.
Solution: Use the same buflen as unix_expandpath() in dos_expandpath().
Remove an unnecessary STRLEN() while at it (zeertzjq).
closes: vim/vim#1689600a749bd90
(cherry picked from commit ec8fc28743)
Problem: Buffer overflow when expanding long file name.
Solution: Use a larger buffer and avoid overflowing it. (Yee Cheng Chin,
closesvim/vim#12201)
a77670726e
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
(cherry picked from commit b0b61c42b3)
Problem: Expanding path with "/**" may overrun end of buffer.
Solution: Use vim_snprintf().
386c24cd26
Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit ad5bced637)
Problem: heap-buffer-overflow with 'nostartofline' and Ex command in
tag file.
Solution: Set cursor column when moving cursor to line 1 (zeertzjq).
closes: vim/vim#167963ed6659549
Problem: CI sometimes fails for MinGW.
Solution: Use backslashes in HandleSwapExists(). (Christian Brabandt,
closesvim/vim#9078)
4b2c804767
Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 24bd7a4a9c)
Problem: Vim9: check for DO_NOT_FREE_CNT is very slow.
Solution: Move to a separate function so it can be skipped by setting
$TEST_SKIP_PAT.
dae453f339
Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 1bf9a7ce95)
A binary format spec always expects a corresponding unsigned long long
value. However, that explicit handling didn't get included when porting
the code from Vim, so binary format spec was falling through to the
"unsigned" and "length_modifier = NUL" portion of the code:
} else {
// unsigned
switch (length_modifier) {
case NUL:
uarg = (tvs
? (unsigned)tv_nr(tvs, &arg_idx)
: (skip_to_arg(ap_types, ap_start, &ap, &arg_idx,
&arg_cur, fmt),
va_arg(ap, unsigned)));
break;
This incorrectly read an "unsigned" value from an "unsigned long long"
variable, which would produce incorrect results on certain platforms.
(cherry picked from commit 453f2c52d2)
Same idea as a7be4b7bf8, but that only showed the context if the
length of the string differed. Since these tests check both string
length and string content, the ctx should be provided for both.
ERROR test/unit/testutil.lua @ 797: vim_snprintf() positional arguments
test/unit/testutil.lua:769: test/unit/testutil.lua:753: (string) '
test/unit/strings_spec.lua:159: snprintf(buf, 4, "%1$0.*2$b", 12ULL, cdata<int>: 0xf78c8ed8) = 001100
Expected objects to be the same.
Passed in:
(string) '000'
Expected:
(string) '001''
(cherry picked from commit 1c81734871)
Problem: On 32-bit architectures, musl libc makes heavy use of
__typeof__ as part of its __REDIR macro for optional backwards
compatibility with 32-bit time_t values. Unfortunately, the
__typeof__ keyword is not supported by the LuaJIT C parser.
Solution: Filter out the keyword in filter_complex_blocks.
(cherry picked from commit db2c3d1143)
**Problem:** An erroneous query in the treesitter highlighter gives a
deluge of errors that makes the editor almost unusable.
**Solution:** Detach the highlighter after an error is detected, so that
it only gets displayed once (per highlighter instance).
(cherry picked from commit b0bbe25c48)
Problem: This keyword is used by GCC and Clang to prevent -Wpedantic
(and other options) from emitting warnings for many GNU C extensions.
This is used heavily in Alpine Linux through musl libc and
foritfy-headers. Without filtering the __extension__ keyword some type
definitions are duplicated. For example, timeval is defined once as
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
and once as:
__extension__ struct timeval { time_t tv_sec; suseconds_t tv_usec; };
Without this patch, the LuaJIT C parser doesn't recognize that these
definitions are equivalent, causing unit test to fail on Alpine Linux.
Solution: Filter out the keyword in filter_complex_blocks.
Problem: 'smoothscroll' gets stuck with 'listchars' "eol".
Solution: Count size of 'listchars' "eol" in line size when scrolling.
(zeertzjq)
related: neovim/neovim#32405closes: vim/vim#166272c47ab8fcd
(cherry picked from commit 9f85dace94)
Problem: Error thrown when for invalid line number which may be accessed
in an `on_detach` callback at which point line count is
intentionally set to 0.
Solution: Move empty memline check to before line number check.
(cherry picked from commit 15bc930fca)
Problem:
Some language servers (e.g., rust-analyzer, texlab) are desynced when
the user deletes the entire contents of the buffer. This is due to the
discrepancy between how nvim computes diff and how nvim treats empty
buffer.
* diff: If the buffer became empty, then the diff includes the last
line's eol.
* empty buffer: Even if the buffer is empty, nvim regards it as having
a single empty line with eol.
Solution:
Add special case for diff computation when the buffer becomes empty so
that it does not include the eol of the last line.
Problem: There is no check for buffer validity before processing
semantic tokens response. This can lead to `Invalid buffer id` error
if processing request takes a long time and the buffer is wiped out.
For example, this can happen after by accident navigating to a buffer
from different project which leads to first loading project's
workspace and *then* processing semantic tokens. During that time
a buffer can be wiped out, as navigation to it was by accident.
Solution: Add extra check for buffer validity before processing semantic
tokens response.
(cherry picked from commit a9cdf76e3a)
Problem: Syntax engine interpreted contains=TOP as matching nothing
inside included files, since :syn-include forces HL_CONTAINED
on for every included item. After 8.2.2761, interprets
contains=TOP as contains=@INCLUDED, which is also not correct
since it doesn't respect exclusions, and doesn't work if there
is no @INCLUDED cluster.
Solution: revert patch 8.2.2761, instead track groups that have had
HL_CONTAINED forced, and interpret contains=TOP and
contains=CONTAINED using this. (Theodore Dubois)
fixes: vim/vim#11277closes: vim/vim#16571f50d5364d7
Co-authored-by: Theodore Dubois <tblodt@icloud.com>
(cherry picked from commit 878b3b89c3)
Problem: on windows, the neovim executable (and thus the filetypes
associated to open with neovim) has no embedded icon
Solution: create a windows resource file pointing to the icon, and
add it to the nvim binary target
(cherry picked from commit cb84cd5d9f)
When 9.0.1856 was ported, the numbers being formatted as binary were cast
to "unsigned int" rather than uvarnumber_T, as is done upstream.
(cherry picked from commit 1426f3f3ce)
Since these assertions all use a common function to perform the test
assertions, it's difficult to figure out which test failed:
ERROR test/unit/testutil.lua @ 785: vim_snprintf() positional arguments
test/unit/testutil.lua:757: test/unit/testutil.lua:741: (string) '
test/unit/strings_spec.lua:143: Expected objects to be the same.
Passed in:
(number) 6400
Expected:
(number) 6'
exit code: 256
Adding context to the assertion makes it clearer what the problem is:
ERROR test/unit/testutil.lua @ 785: vim_snprintf() positional arguments
test/unit/testutil.lua:757: test/unit/testutil.lua:741: (string) '
test/unit/strings_spec.lua:149: snprintf(buf, 0, "%1$0.*2$b", cdata<unsigned int>: 0xf78d0f38, cdata<int>: 0xf78dc4e0) = 001100
Expected objects to be the same.
Passed in:
(number) 6400
Expected:
(number) 6'
exit code: 256
(cherry picked from commit a7be4b7bf8)
This is maintenance release, focusing on bug fixes. It also contains changes
to the available binary releases.
A Linux AArch64 binary has been added as part of the binary releases.
In addition, the previous "linux64" binary has been renamed to "linux-x86_64".
This is a BREAKING changes for scripts which consumes our binary releases.
FIXES
--------------------------------------------------------------------------------
- a8eddf1eb1 checkhealth: failed if 'lua' in plugin name
- 2bc5e1be0f decor: set invalid flag for end of invalidated paired marks
- d8149e5af9 inspect: use correct default highlight
- 357ee88606 jobs: do not block UI when jobwait() doesn't block (#31803)
- b0b383bff9 lsp: minimum height for floating popup #31990
- 4b25fe09cc lua: prevent SIGSEGV when lua error is NULL in libuv_worker (#32091)
- e477ac7c45 marks: revise metadata for start mark of revalidated pair #32017
- 22a327a20e mpack: remove invalid bool definition
- 87440e7bc5 runtime: let matchit and matchparen skips fallback on treesitter captures
- f132efaefb search: avoid quadratic time complexity when computing fuzzy score (#32153)
- ca10442e01 treesitter: don't open fold when o/O adds a line below #28709
- 323c43e1c4 treesitter: uv_dlclose after uv_dlerror
- a3cc513b67 treesitter.foldexpr: only refresh valid buffers
- a986048cb0 treesitter.foldexpr: refresh in the buffers affected by OptionSet
- d7ee06124d treesitter.foldexpr: robustness against ctrl-c
- 79030bf196 ui: ensure screen update before waiting for input #30576
- 3a50639331 9.1.0699: "dvgo" is not always an inclusive motion (#30173)
- 6a6c6b2658 9.1.0708: Recursive window update does not account for reset skipcol (#30217)
- 938a600847 9.1.1048: crash after scrolling and pasting in silent Ex mode (#32168)
BUILD
--------------------------------------------------------------------------------
- fdcdf560da release: add linux-arm64 appimage and tarball
- a7392c04d9 tests: add arm64 runner
Remove `nvim-linux64.tar.gz` and `nvim.appimage` as maintaining
these is too much work.
Also fix directory names to be consistent.
(cherry picked from commit 318676ad13)
Problem: No releases for ARM Linux.
Solution: Provide appimages and tarballs for `linux-arm64`. Rename
x86 releases to `linux-x86_64` for consistency.
(cherry picked from commit c1718d6863)
Problem: Some CI jobs are redundant: `RelWithDebInfo` is already tested
on Linux-Arm64; `MinSizeRel` and Ninja Multi Config are not sufficiently
relevant in practice to spend CI cycles on.
Solution: Remove `build-types` job.
(cherry picked from commit 0fd4ef5da7)
Problem: Linux `aarch64`/`arm64` builds are not tested.
Solution: Add `ubuntu-arm` runners to test matrix (using
`RelWithDebInfo` build).
(cherry picked from commit 3702bcb139)
Problem: Crash after scrolling and pasting in silent Ex mode.
(fizz-is-on-the-way)
Solution: Don't move cursor to line 0 when scrolling.
(zeertzjq)
closes: vim/vim#16506df098fedbc
(cherry picked from commit a9c12d4c29)
Problem: "dvgo" is not always an inclusive motion
(Iain King-Speir)
Solution: initialize the inclusive flag to false
fixes: vim/vim#15580closes: vim/vim#15582f8702aeb8f
Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 0346666f71)
Problem: autocmd to refresh folds always uses the current buffer if the
option type is local. However, the current buffer may not have a parser,
and thus the assert that checks for a parser could fail.
Solution: check if the foldinfo contains the buffer, and only refresh if
so.
Problem:
Exiting the insert mode with ctrl-c does not trigger InsertLeave
autocmd. This may lead to nil error in treesitter foldexpr.
Solution:
Check nil. Folds still can be stale after exiting the insert mode with
ctrl-c, but it will be eventually updated correctly.
An alternative solution would be to ensure that exiting the insert mode
always triggers do_foldupdate. This can be done either by "fixing"
ctrl-c or with on_key callback that checks ctrl-c (nvim-cmp does this).
Problem:
`o`-ing on a folded line opens the fold, because the new line gets the
fold level from the above line (level '='), which extends the fold to
the new line. `O` has a similar problem when run on the line below a
fold.
Solution:
Use -1 for the added line to get the lower level from the above/below
line.
Problem:
Calling `xstrdup` with a NULL pointer causes a SIGSEGV if `lua_tostring` returns
NULL in `nlua_luv_thread_common_cfpcall`.
Crash stack trace:
- `_platform_strlen` → `xstrdup` (memory.c:469)
- `nlua_luv_thread_common_cfpcall` (executor.c:281)
Solution:
Check if `lua_tostring` returns NULL and pass NULL to `event_create` to avoid the crash.
(cherry picked from commit a5b1b83a26)
Co-authored-by: 林玮 (Jade Lin) <linw1995@icloud.com>
Problem: Metadata may be revised for end mark of a revalidated pair.
Solution: Revise metadata for start mark of a revalidated pair.
(cherry picked from commit 5cc93ef472)
Problem:
The floating window for hover and signature help always cuts off a few lines,
because the `_make_floating_popup_size` function counts empty lines as having
zero height.
Solution:
Ensure the height is at least 1.
(cherry picked from commit a4f575abd8)
When treesitter is enabled, by default syntax groups are not defined, but these
groups are used to identify where to skip matches in matchit and matchparen.
This patch does three things:
1. If syntax is enabled regardless of treesitter (`vim.bo.syntax='on'`):
Use original implementation.
2. If treesitter is enabled and syntax is not:
Match the syntax groups (i.e. `comment\|string`) against treesitter captures
to check for skipped groups.
3. Add an explicit treesitter syntax for marking captures to skip:
matchit uses `b:match_skip` to determine what counts as skippable
Where 's:comment\|string' uses a match of the named syntax groups against
a regex match of comment\|string, 't:comment\|string' now uses vim regex
to match against the names of the treesitter capture groups.
(cherry picked from commit 69aa33d890)