Problem:
Previously the index was only checked against the UTF8 length. This
could cause unexpected behaviours for strings containing multibyte chars
Solution:
Check indicies correctly against their max value before returning the
fallback length
(cherry picked from commit 80e37aa533)
Problem: Setting title while TUI buffer is almost full may cause the
end of a flush to be treated as a part of an OSC 2 or OSC 0
sequence, leading to problems like invisible cursor.
Solution: Make the whole sequence to set title a unibi_ext string.
(cherry picked from commit 4846bf05dc)
Now that #16425 is fixed, use Unicode again to reduce screen height.
Unfortunately composing chars still can't be used, as it turns out that
composing chars may be missing when sent separately from the base char
at the last char a screen line.
(cherry picked from commit 1189c5ce59)
Problem: test_strftime may fail because of missing TZ data
Solution: Use GMT offsets to validate timezone differences (James McCoy)
Some systems only provide timezones that follow the geographical region
naming (e.g. America/New_York) by default and require an additional
install for other names (like EST).
The GMT+<offset> format must always be honored, so use that to generate
distinct data for the test.
closes: vim/vim#15848ea997edc7a
Co-authored-by: James McCoy <jamessan@jamessan.com>
(cherry picked from commit b0ddc1783a)
Problem:
Int pointer cast to unsigned long pointer causes potential memory
corruption.
Solution:
Cast and store value first, then pass the new pointer.
(cherry picked from commit 60e1862ccb)
Problem: screenpos() may return invalid position
after switching buffers (Greg Hurrell)
Solution: reset w_leftcol if wrapping has been set
after copying wrap option
fixes: vim/vim#15792closes: vim/vim#15803b065a10e24
Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 9f26bdc416)
This is a maintainance release.
FEATURES
--------------------------------------------------------------------------------
- a3f9bd7f79 jumplist: allow opting out of removing unloaded buffers (#30419)
FIXES
--------------------------------------------------------------------------------
- be831a725d api: error properly with invalid field in nvim_open_win (#30078)
- 9b4e7c9a0d api: fix crash/leak with float title/footer on error (#30543)
- 26b72b0f91 api: nvim_buf_get_text() crashes with large negative column #28740
- e537379641 channel: handle writing to file instead of pipe (#30520)
- 1fc09b0738 column: set signcolumn width after splitting window (#30556)
- 5cb3505ab8 completion: don't include <Lua function> in -complete= (#30209)
- 40671f18f7 decor: don't use separate DecorSignHighlight for url (#30096)
- 95c3fd4dc0 decor: exclude invalid marks from meta total
- 21157459fe diagnostics: don't apply extmarks to invalid lines #29321
- f31e29fce4 diff: use mmfile_t in linematch
- 3a23149cfc filetype: handle .in files with no filename (#30487)
- 045afa9e8a float: properly find last window of tabpage (#30571)
- 006fd0304c health: fix pyenv root and python exepath detect issue
- 1e1e4066b1 health: return correct name from 'path2name()'
- 339067ab7e lsp: avoid reusing diagnostics from different servers in actions (#30002)
- 5955ef0ba8 lsp: don't send foreign diagnostics to servers in buf.code_action (#29501)
- e13564b9f4 lsp: handle encoding bounds in str_utfindex_enc
- f3675337f0 lsp: handle nil bytes in strings
- b55435f438 lsp: handle out-of-bounds character positions #30288
- d593b20017 lsp: return call hierarchy item, not the index (#30145)
- fa4bd6994d lua: ignore stdout and stderr for xdg-open
- 7284400a34 man: avoid setting v:errmsg (#30052)
- d000c56373 man: check if buffer is valid before restoring 'tagfunc' (#30180)
- b18538527e regexp: fix typo in E888 error message (#30161)
- ef05c514aa runtime: add remaining missing commentstrings (#30252)
- 7e15526dd2 runtime: sync bundled treesitter queries
- ad393c1fc1 runtime: sync bundled treesitter queries
- 316fa168a1 terminal: interrupt/got_int hangs terminal (#30094)
- c9d7ad4a34 treesitter: EditQuery shows swapfile ATTENTION #30536
- a6b2233c3e treesitter: escape things like `"` in omnifunc results
- 68a2259804 treesitter: indent size for inspect_tree #28727
- ba47b440fd treesitter: lint top-level anonymous nodes
- ee57bb5a8e tui: reset active attr ID when OSC 8 sequence is terminated (#29960)
- bce2364f60 tui: set id parameter in OSC 8 sequences (#29847)
- 4ad864dd09 version: return nil with empty string
- d63d379eec vim.ui.open: prefer xdg-open on WSL #30302
- 1f58e27600 win-msi: set installer scope to machine #29895
- 28fba3bf27 window: making float with title/footer non-float leaks memory (#30551)
- 2f3c447605 window: respect hide flag of float windows when switching (#30507)
- 6a44055a71 fix(vim.fs): dirname() returns "." on mingw/msys2 (#30484)
VIM PATCHES
--------------------------------------------------------------------------------
- 797f524337 7c8bbc6: runtime(doc): use mkdir -p to save a command
- 7550947157 9.0.2149: [security]: use-after-free in exec_instructions()
- 771b3a52c5 9.0.2158: [security]: use-after-free in check_argument_type
- a0a95edb2d 9.1.0638: E1510 may happen when formatting a message for smsg() (#29907)
- 1fda01fa55 9.1.0647: [security] use-after-free in tagstack_clear_entry
- 05e72488b9 9.1.0648: [security] double-free in dialog_changed()
- 2e1f656eb7 9.1.0653: Patch v9.1.0648 not completely right
- eec37b6e6b 9.1.0666: assert_equal() doesn't show multibyte string correctly (#30018)
- 9f8a5cd022 9.1.0667: Some other options reset curswant unnecessarily when set (#30020)
- 1ed493cc96 9.1.0694: matchparen is slow on a long line (#30134)
- 974447bfc3 9.1.0707: [security]: invalid cursor position may cause a crash (#30204)
- 886a8b62c5 9.1.0716: resetting setcellwidth() doesn't update the screen (#30274)
- 260ac4b3a2 9.1.0728: [security]: heap-use-after-free in garbage collection with location list user data
- b4824edac1 9.1.0729: Wrong cursor-screenline when resizing window
- 4abd480e8f 9.1.0730: Crash with cursor-screenline and narrow window
- 687c0078c2 9.1.0753: Wrong display when typing in diff mode with 'smoothscroll' (#30614)
- 8611f4dcf0 b584117: runtime(doc): buffers can be re-used (#30300)
- b5a2d52a36 e2c4e07: runtime(doc): Update :help :command-complete list
- ca6f8ee267 ecd642a: runtime(doc): clarify, that register 1-9 will always be shifted (#29476)
REFACTOR
--------------------------------------------------------------------------------
- 6aba2f3944 move some functions out of eval.c (#29964)
BUILD SYSTEM
--------------------------------------------------------------------------------
- 8d842a301c add quotes around `CMAKE_GENERATOR` variable
- e63e0a2e06 make makefile work on windows
- 1db8824fbc remove nix flakes (#28863)
- 53e37391e8 silence "po" noise #30469
- 983482626d work around bug in make when PATH includes cmake as dir
- 50a021e653 "Makefile: use pattern rules for build/.deps (#10366)"
CI
--------------------------------------------------------------------------------
- b020b66005 add `needs:backport` label on backport PRs with conflict
- 9d7711a732 don't add reviewers for PRs created by a bot
- 6f34f07a31 enable automerge by default when backporting
- 2c95d48083 remove "skip ci" tag
- d585f3103d skip automerge step if backport failed
- b65e978a23 update labeler configuration and add reviewers
TESTING
--------------------------------------------------------------------------------
- d535482ab2 api/buffer_updates_spec: prevent flakiness (#30521)
- 6a0d1eee46 api/window_spec: remove duplicate test (#30538)
- 61b0816790 health: "test_plug/health/init.lua" completes as "test_plug"
- 2a8d80a442 tui_spec: prevent another case of race between paste and input (#30481)
DOCUMENTATION
--------------------------------------------------------------------------------
- b380a8fe21 remove mention of removed parsers
- c7e943a181 eval: fix wrong return type of getcharsearch() (#30176)
- c2625b6fad treesitter: don't quote metadata
Problem: Wrong display when typing in diff mode with 'smoothscroll'.
Solution: Use adjust_plines_for_skipcol() (zeertzjq).
closes: vim/vim#1577647f8584a80
(cherry picked from commit 0e484c2041)
Problem: For :InspectTree, indent size (`&shiftwidth`) for the tree
viewer may be incorrect.
This is because the tree viewer buffer with the filetype `query` does
not explicitly configures the tab size, which can mismatch with the
default indent size (2) assumed by TSTreeView's implementation.
Solution: Set shiftwidth to be the same as TSTreeViewOpts specifies,
which defaults to 2.
(cherry picked from commit 5331f87f61)
Problem:
Linematch used to use strchr to navigate a string, however strchr does
not supoprt embedded NULs.
Solution:
Use `mmfile_t` instead of `char *` in linematch and introduce `strnchr()`.
Also remove heap allocations from `matching_char_iwhite()`
Fixes: #30505
(cherry picked from commit c65646c247)
Problem:
EditQuery shows swapfile ATTENTION, but this buffer is not intended for
preservation (and the dialog breaks the UX).
Solution:
Set 'noswapfile' on the buffer before renaming it.
(cherry picked from commit b63cd8cbae)
Problem:
fnamemodify with the :r flag will not strip extensions if the filename
starts with a ".". This means that files named ".in" could cause an
infinite loop.
Solution:
Add early return if the filename was not changed
(cherry picked from commit 032e024f8a)
fix(vim.fs): dirname() returns "." on mingw/msys2 #30480
Problem:
`vim.fs.dirname([[C:\User\XXX\AppData\Local]])` returns "." on
mingw/msys2.
Solution:
- Check for "mingw" when deciding `iswin`.
- Use `has("win32")` where possible, it works in "fast" contexts since
b02eeb6a72.
Problem: When input immediately follows end of bracketed paste, the
nvim_input may be processed before the nvim_paste.
Solution: Ensure some waiting after the end of a bracketed paste.
(cherry picked from commit 5acdc4499e)
Problem:
Noise in stderr from src/nvim/po/CMakeLists.txt during build:
48 substitutions on 48 lines
"optwin.js" "optwin.js" 1299L, 57582B written
385 substitutions on 385 lines
"nvim.pot" "nvim.pot" 9318L, 180177B written
Solution:
Run with `-c silent source` instead of `-S`.
(cherry picked from commit cac86e9b4c)
There appears to be a bug in `make` where if a rule asks `make` to
invoke a command called `foo`, and `foo` exists somewhere in `$PATH` as
a directory (not an executable file), `make` will attempt to `execve`
that directory instead of continuing to search in later parts of the
`$PATH` for `foo` as a true executable.
The cause can be traced back to a bug in Make 4.3 which stems from their
use of the findprog function in Gnulib. This was reported to the Make
maintainers here:
https://savannah.gnu.org/bugs/index.php?57962
and then forwarded to the Gnulib maintainers here:
https://github.com/coreutils/gnulib/commit/7b1de4a
Make 4.4 does not have this bug, and I can confirm that I'm able to run
make in the Neovim repo with no further modifications to my system than
upgrading the version of make I'm using to 4.4 or 4.4.1.
As the change is small enough, and it's unlikely that make version
around the world is going to be updated in a timely manner, it makes
sense to just add a workaround for this. Using `command -v` to resolve
the `cmake` command, similar to what is already being done with
`cmake3`, makes it work correctly in all cases. Continuing to include
`... || echo cmake` at the end means that if neither `cmake3` nor
`cmake` are installed, the user will still see a message about CMake
being missing.
Co-authored-by: Jake Zimmerman <zimmerman.jake@gmail.com>
(cherry picked from commit e268fcbdaa)
This will fix the following error when using generators that have a
space in them, e.g. "Unix Makefiles":
"CMake Error: Could not create named generator Unix".
Closes https://github.com/neovim/neovim/issues/30218.
(cherry picked from commit ef8067a19d)
Using powershell as the default windows shell as using cmd alters $PATH
in a way that makes building neovim fail (powershell prioritizes visual
studio tools which is arguably more correct).
This was tested with gnu make for windows, which can be installed with
e.g. scoop. It does not work with nmake and it is extremely unlikely we
want to add nmake support as the makefile is merely supposed to be
syntactic sugar for the most common case. For similar reasons, the only
supported generator is ninja.
(cherry picked from commit 4ee65484b1)
This reverts commit 7f6ff829aa.
The given reasoning and usecase is unsatisfactory. While it is true that
it allows to run `make build/bin/nvim`, it can easily be recreated with
`ninja -C build bin/nvim` which does the exact same thing. This minor
convenience is not worth adding the extra code given how rare this
usecase should be.
(cherry picked from commit 3085c9d9da)
**Problem:** Top-level anonymous nodes are not being checked by the
query linter
**Solution:** Check them by adding them to the top-level query
This commit also moves a table construction out of the match iterator so
it is run less frequently.
This will ensure automatic backports created by the backport action does
not request reviewers (since the commit in question has already been
vetted and merged), but manual backports created by users does request
reviewers as these commits has not been vetted previously.
(cherry picked from commit 755512ed60)
Problem: Crash with cursor-screenline and narrow window
(elig0n)
Solution: Don't set right_col when width2 is 0 (zeertzjq).
fixes: vim/vim#15677closes: vim/vim#1567859149f0269
(cherry picked from commit 5191a11d66)
Problem: Wrong cursor-screenline when resizing window
Solution: Invalidate saved left_col and right_col when width1 or width2
change.
closes: vim/vim#1567986dc4f8b43
(cherry picked from commit 90585e47fe)
Problem: heap-use-after-free in garbage collection with location list
user data.
Solution: Mark user data as in use when no other window is referencing
the location list (zeertzjq)
fixes: neovim/neovim#30371closes: vim/vim#15683be4bd189d2
Problem:
The LSP omnifunc can insert nil bytes, which when read in other places
(like semantic token) could cause an error:
semantic_tokens.lua:304: Vim:E976: Using a Blob as a String
Solution:
Use `#line` instead of `vim.fn.strlen(line)`. Both return UTF-8 bytes
but the latter can't handle nil bytes.
Completion candidates can currently insert nil bytes, if other parts of
Alternative fix to https://github.com/neovim/neovim/pull/30359
Note that https://github.com/neovim/neovim/pull/30315 will avoid the
insertion of nil bytes from the LSP omnifunc, but the change of this PR
can more easily be backported.
(cherry picked from commit 8512f669f0)