Problem: `:Inspect` does not show priority for treesitter highlights,
leading to confusion why sometimes earlier highlights override later
highlights.
Solution: Also print priority metadata if set.
(cherry picked from commit 9c278af7cc)
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)
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: 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:** 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.
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)
`path2name()` function doesn't process `'pluginname/health/init.lua'` correctly. Instead of retruning `'pluginname'` it returns `'pluginname.health'`
(cherry picked from commit 237d2aef4d)
Problem:
str_utfindex_enc could return an error if the index was longer than the
line length. This was handled in each of the calls to it individually
Solution:
* Fix the call at the source level so that if the index is higher than
the line length, utf length is returned
(cherry picked from commit f279d1ae33)
Problem:
str_byteindex_enc could return an error if the index was longer than the
lline length. This was handled in each of the calls to it individually
Solution:
* Fix the call at the source level so that if the index is higher than
the line length, line length is returned as per LSP specification
* Remove pcalls on str_byteindex_enc calls. No longer needed now that
str_byteindex_enc has a bounds check.
while at it, also move the note about :wincmd
directly to :h :wincmd, it doesn't seem to belong to the buffer section.
closes: vim/vim#15636b584117b05
Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit b40ec083ae)
Problem: The matchparen plugin is slow on a long line.
Solution: Don't use a regexp to get char at and before cursor.
(zeertzjq)
Example:
```vim
call setline(1, repeat(' foobar', 100000))
runtime plugin/matchparen.vim
normal! $hhhhhhhh
```
closes: vim/vim#1556881e7513c86
(cherry picked from commit cf44121f7f)
Problem: When preparing the parameters for a code actions LSP request,
the code set `context.diagnostics` when processing the first LSP client,
and then reused those `context.diagnostics` for subsequent LSP clients.
This meant that the second and next LSP clients got diagnostics that
did not originate from them, and they did not get the diagnostics that
they sent.
Solution: Avoid setting `context.diagnostics` (which is referenced by
all clients). Instead, set `params.context.diagnostics` directly, which
is specific to a single client.
Fixes#30001
Caused by #29501
(cherry picked from commit 7031949be0)
Problem:
If there are errors in the last line of a buffer, something like `Gdk` or
`G2k3J` will produce an error (at least with `lua_ls`):
Error executing vim.schedule lua callback:
.../neovim/share/nvim/runtime/lua/vim/diagnostic.lua:1446: Invalid 'line': out of range
Solution:
Only set extmarks if the target buffer line still exists
(cherry picked from commit e5e81262af)
`buf.code_action` always included diagnostics on a given line from all
clients. Servers should only receive diagnostics they published, and in
the exact same format they sent it.
Should fix https://github.com/neovim/neovim/issues/29500
(cherry picked from commit 720b309c78)
Fix the following two issues:
- pyenv root detection issue
When `PYENV_ROOT` environment variable is not set, neovim will detect
pyenv's root via `pyenv root` command, but which will be always fail
because `vim.fn.system()` returns result with additional `\n`. Using
`vim.system` instead prevents this problem. to trim it before check
whether it is exists
- python executable path detection issue
Filter unrelated `python-config` in cases where multiple python versions
are installed, e.g. `python-config`, `python3.10-config`,
`python3.11-config` etc.
(cherry picked from commit b4b4cf46a7)
This is a maintenance release.
FEATURES
--------------------------------------------------------------------------------
- ebc6c38cde lsp: update LSP healthcheck format (#28988)
BUILD
--------------------------------------------------------------------------------
- ba90b54301 deps: drop unused bundled bash, python parsers and queries
- 803cc08c17 deps: bump tree-sitter-c to v0.21.3
- 91e337a477 deps: bump tree-sitter-query to v0.4.0
- 978b63a9f1 deps: bump tree-sitter-vimdoc to v3.0.0
- b322c3560b "popcount" name conflict on NetBSD #28983
- b397b5672c remove -O2 from gen_cflags
- f77db12995 reuse code for deps.txt for both deps and main build
- 46d2906332 macos: disable deduplication in link step
FIXES
--------------------------------------------------------------------------------
- 70f7708cdf assert failure in VimL expression parser
- 28f03205be show swapfile warning as a warning (#28972)
- 0d293e4315 api: alloc and draw cursor window in nvim__redraw
- e1b6187801 colorscheme: underline StatusLineNC with 'notermguicolors' #28810
- aa1321801d column: clamp line number for legacy signs
- df6ce8377f column: crash with 'signcolumn' set to "number" (#29003)
- 97be9d8563 column: modifying a sign should update placed signs (#29750)
- 21b21b94e6 comment: fall back to using trimmed comment markers (#28950)
- 0827279ff5 defaults: default @/Q broken when 'ignorecase' is set (#29343)
- 5d9f2d7ecc drawline: don't draw beyond end of window (#29035)
- eadc4e03a2 drawline: don't draw beyond end of window with 'rnu' (#29406)
- bec397edda extmarks: issues with revalidating marks #28961
- 1fe1f8556e filetype: fix typos in filetype detection
- ad55ec350c float: handle error in win_float_create() (#29742)
- bf16fe3f01 fs: make vim.fs.root work for relative paths and unnamed buffers (#28973)
- 5eaae797af health: broken ruby detect #28804
- 24ee2e7c74 health: fix fetching url with python in provider health (#29594)
- 7582d4a7b5 input: handle vim.on_key() properly with ALT and K_SPECIAL (#29677)
- 4f0c4c3921 lsp: add textDocument/documentLink to capability map (#28838)
- 2d7aab623e lsp: avoid vim.keymap.del error when stopping a client (#29478)
- bdd5871dc5 lsp: check if buffer was detached in on_init callback (#28942)
- d8ff216040 lsp: clear lsp client diagnostics (#29091)
- 3a727beafd lsp: detach all clients on_reload to force buf_state reload (#28898)
- e98637e8c0 lsp: do not detach from buffer if there are uninitialized clients (#29043)
- 0ee3147bc7 lsp: do not reset buf version when detaching client (#29273)
- 24fa65a500 lsp: don't show codelens for buffers that don't support it (#29690)
- 4efca7cda5 lsp: handle nil root_dir in health check (#29010)
- efe8a0a520 lsp: hide layout in codelenses in virtual text (#28794) (#28895)
- 2fb69ccaf7 lsp: inlay hints are rendered in the correct order (#29707)
- dfff482efe lsp: remove superfluous on_detach callback from semantic tokens module (#29188)
- 10a16c1311 lsp: trigger LspDetach on buffer delete
- 33121f1eae lua: change some vim.fn.expand() to vim.fs.normalize() (#29583)
- ffc457a1dc marks: revalidate marks whose position did not change
- f82d7b8200 mouse: early return when clicking in padded 'statuscolumn' (#29394)
- d6756fc0a5 move: half-page scrolling with resized grid at eob (#28821)
- 0cf7e2570c path: avoid chdir() when resolving path (#28799)
- 63ff7338ea quickfix: make shortmess+=O work with cmdheight=0 (#29609)
- 46c2962b3a runtime: add commentstring for glsl ftplugin
- b98aa783f3 runtime: source c ftplugin properly for cpp on Windows (#29053)
- 039121f5a3 snippet: cancel snippet session when leaving the buffer (#29044)
- 84d7bfcf16 snippet: don't override unnamed register on tabstop select (#29008)
- e13f03af85 snippet: modify base indentation when there's actually whitespace (#29670)
- 9fd6664ba7 tohtml: extmark text may be out of bounds
- 8c88f402e1 tohtml: ignore lsp inlay hints
- 5cdf0c22bd tohtml: properly handle multiple hl groups #29012
- 3d319092d5 tohtml: replace ipairs with pairs
- 4150e5e6fd tohtml: show how many warnings are hidden
- 0389472961 tohtml: support ranges again
- ab2d243fd0 treesitter: display fields for anonymous nodes in :InspectTree
- 35f6425207 treesitter: do not modify highlight state for _on_spell_nav
- 356ddb1305 treesitter: ensure syntaxset augroup exists (#29542)
- eb53aba5af treesitter: recognize aliased parsers in omnifunc, query linter
- b6b2272573 tui: move $COLORTERM check to _defaults.lua (#29206)
- 89f29fcc92 tui: remove duplicate disabling of synchronized output (#28884)
- a784b901be tui: skip TUI in ui_rgb_attached (#29096)
- 19787d6057 ui: avoid ambiguity about last chunk when flushing halfway (#29718)
- 89fa1ee822 ui: flush ext_cmdline events before doing cmdpreview (#29062)
- 7055cd1238 ui: superfluous showmode / excessive grid_cursor_goto #29089
- 6802db7aa1 version: fix vim.version().prerelease
- 728f6c7c83 vim.text: remove assert from vim.text.hexdecode
- c3aef56199 win-msi: add bin to PATH per-machine after installation (#29099)
VIM PATCHES
--------------------------------------------------------------------------------
- fdf769fa86 0b74eec: runtime(stylus): remove remaining css code (vim/vim#14866)
- 29fd7432fd 74703f1: runtime(doc): remove obsolete Ex insert behavior (#29702)
- 891cc78179 7a85e34: runtime(doc): fix inconsistencies in :h file-searching (#29652)
- 704d33634e 8.2.0083: text properties wrong when tabs and spaces are exchanged
- 571e54e12c 8.2.0109: corrupted text properties when expanding spaces
- 7c055bd74b 8.2.3388: fnamemodify('path/..', ':p') differs from using 'path/../' (#29667)
- 9c91233a38 9.1.0414: Unable to leave long line with 'smoothscroll' and 'scrolloff'
- 34cc49bd72 9.1.0498: getcmdcompltype() interferes with cmdline completion (#29397)
- 259a620eb8 9.1.0512: Mode message for spell completion doesn't match allowed keys (#29437)
- f89d4ee6ce 9.1.0526: Unwanted cursor movement with pagescroll at start of buffer (#29569)
- 4ce293c2c3 9.1.0565: Stop directory doesn't work properly in 'tags'
- c467bfeb93 9.1.0566: Stop dir in findfile() doesn't work properly w/o trailing slash
- 576363a0fb 9.1.0567: Cannot use relative paths as findfile() stop directories
- ceb82a9396 9.1.0569: fnamemodify() treats ".." and "../" differently (#29673)
- 07de890de6 9.1.0580: :lmap mapping for keypad key not applied when typed in Select mode (#29693)
- b01202df15 9.1.0594: Unnecessary redraw when setting 'winfixbuf' (#29775)
- 804a94d300 9.1.0601: Wrong cursor position with 'breakindent' when wide char doesn't fit (#29793)
- a03cc83bfb df62c62: runtime(doc): grammar fixes in options.txt (#29729)
- fde5718e62 partial:9.0.0323: using common name in tests leads to flaky tests
REDACTOR
--------------------------------------------------------------------------------
- c35e040b7e replace deprecated vim.loop with vim.uv
- 3a354bfcaa lsp: reuse buf_detach_client logic in on_detach (#28939) (#29024)
- dffadc392e path.c: add nonnull attributes (#28829)
- db65017e60 tests: more global highlight definitions
- 3725db69ef tests: use more global highlight definitions
CI
--------------------------------------------------------------------------------
- 7400f9dfe5 adjust workflows to enable required checks
- 575136c178 always add `target:release` label when backporting
- 410f43c0ae bump backport action to version 3
- 9a2760a01f change label `backport` to `target:release`
- b94b341ef2 run workflows on release branches
- 0e81c62405 skip lintcommit workflow on release branches
TESTING
--------------------------------------------------------------------------------
- f03348472d add a test for #29119
- 18a36d3d9f do not set termguicolors in test runner
- 68513c2a89 fix reporting "no flush received" too early (#29735)
- 981548b7f7 remove checks for failed tests on Windows
- 65776124b1 starting and stopping treesitter highlight (#29546)
DOCUMENTATION
--------------------------------------------------------------------------------
- 891b235df0 document 'list' behavior when 'listchars' excludes "tab" (#29360)
- 8c00651131 fix more treesitter parsing errors
- 777e15fa61 update LSP quickstart (#28989)
- 6136326d63 lpeg: merge upstream changes
- f7d8650616 lsp: format the handwritten part #29295
Problem: :TOhtml doesn't properly handle virtual text when it has
multiple highlight groups. It also improperly calculates position offset
for multi-byte virt_text characters.
Solution: Apply the `vim.api.nvim_strwidth` broadly to properly
calculate character offset, and handle the cases where the `hl` argument
can be a table of multiple hl groups.