Commit Graph

38076 Commits

Author SHA1 Message Date
zeertzjq
e25e86a9ed vim-patch:9.2.1067: Completion shows an included file by full path (#41849)
Problem:  A match found in an included file is shown with the full path
          of the file, while a match from a buffer is shown with the
          name under the current directory.  A file included as
          "./file" even has the "./" left in: "dir/./file".
Solution: Show the file by its name under the current directory, and
          simplify the name of a file found relative to the current
          one (Hirohito Higashi).

closes: vim/vim#21264

cff83f361d

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-09-11 02:40:11 +00:00
zeertzjq
486f820a98 Merge pull request #41847 from zeertzjq/vim-cbcb209
vim-patch: runtime file updates
2026-09-11 09:24:07 +08:00
zeertzjq
fcf32b8219 vim-patch:36d01cf: runtime(typst): do not highlight code blocks and raw text
Similar to markdown syntax, by default do not highlight raw and code blocks.

Syntax highlighting groups are still in place so it is possible for
users to add their own if needed.

- typstMarkupRawInline
- typstMarkupRawBlock

closes: vim/vim#21260

36d01cff54

Co-authored-by: Maxim Kim <habamax@gmail.com>
2026-09-11 08:57:59 +08:00
zeertzjq
5bab388c47 vim-patch:71a0e7c: runtime(netrw): netrw#fs#Glob() cannot list a remote directory
Problem:  netrw#fs#Glob() calls s:NetrwRemoteListing() and uses
          s:THINLIST, which are script-local to autoload/netrw.vim and
          not visible in autoload/netrw/fs.vim.  Listing a remote
          directory in the tree view fails with E117 and E121.
Solution: Use netrw#Call() and netrw#Expose(), which exist to reach
          the script-local functions and variables of netrw.vim.

closes: vim/vim#21259

71a0e7ca13

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-09-11 08:57:10 +08:00
zeertzjq
619d3ee5cf vim-patch:cbcb209: runtime(python): missing Python syntax keywords
Problem:  Missing newer Python keywords and builtins in syntax highlighting.
Solution: Add aiter, anext, BaseExceptionGroup, ExceptionGroup,
          PythonFinalizationError, and EncodingWarning to the Python
          syntax file (231tr0n).

closes: vim/vim#21254

cbcb209221

Co-authored-by: 231tr0n <zeltronsrikar@gmail.com>
2026-09-11 08:56:58 +08:00
bfredl
26e3c1824c Merge pull request #41827 from chernetskyi/fix/kvec-macro-hygiene
fix(klib): parenthesize kvec macro arguments
2026-09-10 22:25:47 +02:00
Lewis Russell
9dd0eeb6ea refactor(help): reuse help.lua to generate build tags
Make gen_helptags.lua call help.lua instead of keeping its own tag
parser. Builds and :helptags now use the same code.

Allow the shared code to run without Neovim, and fail the build when tag
generation reports an error.

AI-assisted
2026-09-10 20:05:49 +01:00
Justin M. Keyes
e973eb4a8f fix(multicursor): undo corrupted by insert that changes line-count #41835
Problem:
Undo "u" is wrong after cascading an insert that adds a line (`A{<CR>`, `o`, …).

The cascade replays the insert as a per-cursor `edit()`, where `u_save`
stores a line multiple times into the undo block at different line
counts; then `getbot` computes conflicting entries that undo each other.

Solution:
`u_save` the whole affected line-range as one entry at session start,
the same approach used by Vim for linewise ops (`op_shift`, `ex_sort`).
The "enclosing" `u_save` wins and the invalid entries are overridden.
2026-09-10 11:06:08 -04:00
Lewis Russell
515c61f075 perf(fs): defer path joining in find()
Only join paths for matches and entries needed for traversal. This
avoids string processing for rejected files and improves selective
searches across the Neovim tree by about 19-25%.

AI-assisted
2026-09-10 14:57:10 +02:00
Lewis Russell
d663d8f4b3 perf(help): generate helptags with LPeg
Problem: Generating helptags builds and queries a full vimdoc syntax
tree. This is much slower than the previous scanner and also happens
before discovering that the tags file cannot be written.

Solution: Extract tags with an LPeg grammar, reading each file once and
skipping example blocks and ordinary text. Open the output first so
unwritable directories can return immediately.

This restores legacy handling of tags inside inline code spans. On an
arm64 Mac, the 5.36 MB runtime corpus takes 24 ms instead of 604 ms,
with identical generated tags.

AI-assisted
2026-09-10 12:34:13 +01:00
github-actions[bot]
37c72fb619 docs: update version.c #41729
vim-patch:015c84ce5 runtime(doc): add missing usr_52 entry to toc
vim-patch:59bd74ed4 translation: include vim.pot in the repository
vim-patch:5d552d652 translation: ignore vim.pot creation date, regenerate it, rm allfiles
vim-patch:3c8d32e4f translation: comment out deletion of *.pot file in Makefiles
vim-patch:238b0b058 tests(commondumps): Mark and fold lines in screendump views
vim-patch:cb65fe17e tests(commondumps): Make mark-line-related optimisations
vim-patch:e543abbf8 tests(commondumps): Use character counts when marking columns
vim-patch:e17d10c2d CI: Bump github/codeql-action
vim-patch:9.2.1039: MS-Windows: Unix domain socket channels fail
vim-patch:9.2.1050: tests: test_suspend() fails on Solaris
vim-patch:9.2.1053: libvterm: characters can get a different width in a terminal window

vim-patch:46ff48ba77bbf167a646f84053e96342357446b3

vim-patch:9.2.1043: matchlist() allocates empty strings for unmatched submatches
vim-patch:9.2.1044: Vim script execution is slower than necessary
vim-patch:9.2.1051: getdigits() overflow behaviour is not portable
vim-patch:9.2.1061: computing the displayed width of a line is slower than necessary
2026-09-10 06:06:01 -04:00
zeertzjq
b99d1b0a5a vim-patch:9.2.1052: filetype: evcxr history files are not recognized (#41797)
Problem:  filetype: evcxr history files are not recognized
Solution: Detect evcxr/history.txt as rust filetype (Wu, Zhenyu).

Reference:
https://github.com/evcxr/evcxr/blob/main/evcxr_repl/README.md

closes: vim/vim#21164

e6bc60ce1b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2026-09-10 09:57:31 +00:00
Justin M. Keyes
8c292c96dd fix(autocmd): dot-repeat triggers InsertCharPre #41806
Problem:
InsertCharPre is triggered for stuffed text (".", i_CTRL-R, i_CTRL-A).
But that text was already transformed when it was typed: the `v:char`
result is appended to the redo buffer literally (`redo_append_lit()`).
So "." transforms it again, e.g. an autopair handler turns "()" into
"())".

Solution:
Skip InsertCharPre for stuffed text.

Precedent: `vgetorpeek()` disables abbreviations for stuffed text for
the same reason (it is post-expansion).

Macros are unaffected.
2026-09-10 05:57:03 -04:00
Volodymyr Chernetskyi
1a3ebc620d fix(klib): parenthesize kvec macro arguments
Problem:
The kvec append and reserve macros do not parenthesize length arguments.
Compound expressions can change the allocation and copy sizes, causing
buffer overflows for elements larger than one byte. The append macros
also expand to bare if statements, making them unsafe to use in unbraced
if/else statements.

Solution:
Parenthesize length and data arguments and wrap both append macros in
do/while statements.

AI-assisted
2026-09-10 11:13:36 +02:00
Yanuo Ma
0c9012f295 revert(scrollbind): revert #41519 due to regressions
Problem:
Resetting w_scbind_pos to the displayed position discards pending
scroll distance. This breaks scrollbind with asymmetric folds and
leaves persistent offsets after tall virtual-line blocks. Wrapped
lines with smoothscroll also show increased follower lag.

Solution:
Revert the original change and its test. This restores the previous
behavior, including the original tall-virt_lines oscillation, while
a replacement is reviewed separately.

This reverts commit b781e95a24.

AI-assisted
2026-09-10 08:22:05 +01:00
Lewis Russell
d039f19af5 build: enable more EmmyLua checks
Enable checks for unused code, deprecated calls, return types, and
annotations.

Fix the warnings and replace the deprecated highlight function. Keep
exceptions where old APIs are still needed or the checker gets it wrong.

AI-assisted
2026-09-09 22:31:58 +01:00
glepnir
08dd3adffb feat(api): add ev.win to autocmd callback args #39826
Problem: Autocmd callbacks currently have to rely on curwin, which may
already have changed by the time they run. This is especially noticeable
for WinNew, WinClosed, WinResized and WinScrolled.

Solution: Track the window in the autocmd context and expose it as ev.win.
Pass it explicitly for the window events that need it.
2026-09-09 15:42:20 -04:00
Justin M. Keyes
ac167f943a fix(terminal): check file timestamps on terminal-job exit #41814
Problem:
When a `:!` command runs, file timestamps are checked and W12 or
`FileChangedShell` is triggered. But not when a `:terminal` job exits.

Only `enter_buffer()` checks, so whether you get the W12 warning depends
on how you happen to return to the file: `:term` works, `:tabnew | term`
does not.

    echo foo > testfile
    nvim --clean testfile
    " Edit the buffer, don't save it.
    :!mv testfile testfile2
    :tabnew | term sh
    touch testfile2 && mv testfile2 testfile
    exit

'autoread' is defeated because `:!mv` deletes the file, so
`should_watch()` fails and the watcher stops. `ensure_watcher()` only
re-runs on `BufReadPost`/`BufWritePost`/`OptionSet`, so nothing watches
the file when the terminal moves it back.

Solution:
Set `need_check_timestamps` on terminal-job exit, same as `:!cmd`
(`os_shell`).
2026-09-09 15:14:26 -04:00
stenja
a55f134ee3 fix(lsp): stale client when rpc.connect fails #41792
Problem:
When vim.lsp.rpc.connect is used for an LSP and the connection fails
(due to ECONNREFUSED, for example), the LSP client is left
uninitialized. Subsequent calls to vim.lsp.start will reuse the
uninitialized client, but no new connection will be attempted.

Solution:
When vim.lsp.rpc.connect encounters a connection error, terminate the
client. This allows the user to do something in response to the failed
connection in the on_exit callback, and also makes it so subsequent
attempts to start the LSP will try to establish a new connection rather
than using the previous uninitialized client.

Co-authored-by: Jason Stenftenagel <jasonstenftenagel@gmail.com>
2026-09-09 13:31:26 -04:00
Justin M. Keyes
d24cafc06a fix(multicursor): failed motion at primary is still cascaded #41812
Problem:
In follow-mode, a motion that fails at the primary cursor (e.g. "j" at
EOB) still cascades to other cursors, so they move while the primary
does not, which causes them to be deduplicated...

Also affects Visual sessions: "Vjd" at EOB deletes 1 line at the primary
but (potentially) 2 lines at every multicursor.

Solution:
If a motion "beeps", don't replay it.

"3w" near the end still replays (it moved), as does "0" at column
0 (does not beep). This feels like a usable and intuitive compromise.
2026-09-09 12:10:01 -04:00
Olivia Kinnear
ec2c58ed26 docs: add help tag for vim.async 2026-09-09 15:50:38 +01:00
Tomasz N
0c0b78c79e fix(ui2): :quit on unsaved buffer shows hit-enter prompt #41575
Problem:
"Press any key" modal prompt is shown when `:quit`
from unsaved buffer, even if ui2 is enabled (which 
should never show hit-enter prompt).

Solution:
Skip `wait_return` for `ext_messages` UIs.
2026-09-09 10:21:46 -04:00
Volodymyr Chernetskyi
8e0045f43a feat(lsp): support workspace/foldingRange/refresh #41780
Problem:
Servers cannot request refreshing stale LSP folding ranges after a
project-wide change.

Solution:
Advertise `workspace.foldingRange.refreshSupport` and re-request folding
ranges for active buffers when handling `workspace/foldingRange/refresh`.

AI-assisted
2026-09-09 08:45:10 -04:00
glepnir
0a844adc13 fix(lsp): newlines in the completion word from insertText #41801
Problem:
A textEdit is cut to its first line but an insertText is not, so its
newlines reach the |complete-items| word.

Solution:
Cut it the same way.
2026-09-09 08:04:23 -04:00
Justin M. Keyes
cb2e9cdfd3 fix(multicursor): clipboard=unnamed, explicit "+yy #41804
Problem:
- With `clipboard=unnamed[plus]`, per-cursor yanks are joined into '"'
  on exit, but not the clipboard.
- Multicursor `"+yy` calls the clipboard provider per-cursor, behaving
  as "last wins".

Solution:
- Never cascade to/from the clipboard provider.
- Implicit clipboard (`clipboard=unnamed[plus]`) uses the cursor-local
  unnamed register, so the cascade needs no `start_batch_changes()`. On
  exit, the clipboard gets the same joined result as the `"` register.
- Operations that reference the explicit clipboard registers `"+` / `"*`
  while multicursor is active, use the cached (primary) clipboard value.
2026-09-09 07:25:32 -04:00
Lewis Russell
efdd73c096 feat(watch): add on_error callback
Problem: Watcher failures are reported inconsistently, and callers
cannot detect when a watcher is no longer usable.

Solution: Route startup and event failures and unexpected inotifywait
exits through an optional on_error callback. Log to nvim-watch.log by
default. Ignore disappearing child directories and exits caused by
cancellation. Let LSP log failures and notify once per message, using
INFO for missing roots and ERROR otherwise, without interrupting
registration.

AI-assisted
2026-09-09 11:39:57 +01:00
zeertzjq
318ea4de21 vim-patch:9.2.1054: Virtual Replace mode: BS over multi-byte text eats the padding (#41799)
Problem:  In Virtual Replace mode, backspacing over a character that
          replaced several multi-byte characters deletes the padding
          that follows it, so the text after the cursor loses its
          alignment.
Solution: In replace_do_bs() advance by the length of the character at
          the current offset instead of always measuring the first
          restored character (Volodymyr Chernetskyi).

After the original characters are restored, replace_do_bs() adds up
their screen width so it knows how much of the alignment padding to drop
again. The loop advanced "i" by mb_ptr2len(p) - 1, which always returns
the length of the *first* restored character rather than the length of
the character at the offset being looked at.

One backspace can restore more than one character, because a wide
character may have replaced several narrow ones.  When those characters
do not all have the same byte length the index lands in the middle of a
character: chartabsize() then measures a trailing byte, counts it as an
unprintable <xx> worth four cells, and the inflated width makes the
following loop delete padding spaces that should have been kept.

    call setline(1, 'aé    xyz')
    call feedkeys("gR\u4e00\<BS>\e", 'xt')

leaves "aéxyz" instead of restoring the original line.  Going the other
way round ('éa') happens to work, since there the first character is the
longer one.

This has been wrong since the loop was added in Vim 7.0.

closes: vim/vim#21211

5d934b1bdb

Co-authored-by: Volodymyr Chernetskyi <19735328+chernetskyi@users.noreply.github.com>
2026-09-09 01:22:54 +00:00
zeertzjq
b7f9aceadd vim-patch:5867d1f: runtime(svelte): include svelte syntax script and syntax tests (#41796)
closes: vim/vim#21200

5867d1f8ee

Co-authored-by: 231tr0n <zeltronsrikar@gmail.com>
2026-09-09 00:34:53 +00:00
zeertzjq
338ce77f34 vim-patch:9.2.1041: vim_strbyte() can be improved (#41784)
Problem:  vim_strbyte() can be improved
Solution: Replace the byte-by-byte scan in vim_strbyte() with strchr(),
          preserving its byte-range and NUL behavior (Yasuhiro Matsumoto).

closes: vim/vim#21240

df4ef959d5

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-09-08 22:58:59 +00:00
Justin M. Keyes
493a4dd571 fix(multicursor): mapping that creates initial cursors is not replayed #41788
Problem:
A Visual-mode mapping that creates cursors (`xmap I Q0i`) replays its
commands only if cursors already existed when it started.

Solution:
Always collect `composite`. Consumers are still decided per frame
(`CmdFrame.consumers`) and at emit/cascade.
2026-09-08 12:05:34 -04:00
Lewis Russell
6a54396db4 build: enable more EmmyLua checks
- call-non-callable
- missing-fields
- redefined-label
- redefined-local
- undefined-field
- unreachable-code

Promote redefined-local and unreachable-code to warnings.

Fix DOS line-ending handling for multiline semantic tokens, and support
intersection types in the help parser.

AI-assisted
2026-09-08 16:50:53 +01:00
zeertzjq
ec65796cea vim-patch:9.2.1040: matchfuzzypos() can be improved (#41786)
Problem:  matchfuzzypos() can be improved
Solution: Compute the uppercase character once per character in
          has_match(), instead of repeating the conversion while
          scanning each candidate (Yasuhiro Matsumoto).

closes: vim/vim#21241

c0c3fbd967

Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2026-09-08 15:45:31 +00:00
zeertzjq
e66fdc1eac vim-patch:9.2.1038: CursorLineFold/Sign highlighting depends on 'cursorlineopt' (#41785)
Problem:  CursorLineFold and CursorLineSign are only applied when
          'cursorlineopt' contains "number" or is "both"
          (Evgeni Chasnovski).
Solution: Apply those groups whenever 'cursorline' is set, independent
          of 'cursorlineopt' (Vrushali Zampalkar).

fixes:  vim/vim#20480
closes: vim/vim#21112

1f8d3c44c5

Co-authored-by: Vrushali-Z <zampalkarvasu@gmail.com>
2026-09-08 15:24:45 +00:00
bfredl
623508dc06 Merge pull request #41751 from bfredl/stringly_nils
test(ci): non fatal errors for [NULL] safety in vim_snprintf
2026-09-08 17:12:26 +02:00
zeertzjq
3c9fe92e42 vim-patch:9.2.1045: runtime(netrw): raises E46 when changing directory fails (#41783)
Problem:  Netrw raises E46 when changing directory fails.
Solution: Remove unused assignments to the read-only directory argument
          and cover both error-handling branches with a regression test
          (Qiming zhao).

When :lcd fails with E472, s:NetrwLcd() assigns to a:newdir instead of
returning -1. The fallback assignment also refers to dirname, which is
undefined on this path. Neither assignment can update the caller's
directory variable. Keep the existing option restoration and failure
return while removing the invalid assignments.

Supported by AI.

closes: vim/vim#21226

2f72e4c72f

Co-authored-by: Qiming zhao <chemzqm@gmail.com>
2026-09-08 14:57:40 +00:00
zeertzjq
94636bdff0 vim-patch:58ed368: runtime(org): Fix escape in formatlistpat (#41782)
The regex atom \| needs an extra escape for a :set command

closes: vim/vim#21214

58ed368ab9

Co-authored-by: SPFab <42518661+SPFabGerman@users.noreply.github.com>
2026-09-08 14:28:46 +00:00
Volodymyr Chernetskyi
bea6410138 vim-patch:9.2.1046: regex: case-insensitive match fails on multi-byte string with re=1 (#41781)
Problem:  With 'regexpengine' set to 1 a case-insensitive match against
          a literal string fails when the string starts with a
          multi-byte character that is longer than a character following
          it, so the two regexp engines disagree (after v9.1.0645).
Solution: In cstrncmp() advance by the length of the character at the
          current position instead of always measuring the first
          character of "s1" (Volodymyr Chernetskyi).

cstrncmp() walks "s1" to find how many characters make up "*n" bytes, so
that it can measure out the same number of characters in "s2". The loop
decremented the remaining byte count by mb_ptr2len(s1), which always
returns the length of the *first* character, rather than the length of
the character at the current position "p".

When the first character is longer than a later one the byte count runs
out too early, the character count comes up short, and MB_STRNICMP2() is
handed a length for "s2" that is too small, so the comparison fails. For
example matching "\cüber" against "Überraschung": "über" is five bytes,
but each iteration subtracts two (the length of "ü"), so the loop runs
three times instead of four.

    :set regexpengine=1
    echo matchstr('Überraschung', '\cüber')

returns an empty string, while 'regexpengine' set to 2 correctly returns
"Über". The default value of 0 uses the NFA engine and is unaffected.

related: vim/vim#14756
closes:  vim/vim#21212

4e5ac0d68a
2026-09-08 13:50:03 +00:00
bfredl
b6b190291d fix(api): do not pull a fast one for nvim_del_augroup_by_id
This is a bit more boilerplate because of painful impedance mismatch (is
augroup names the root source of truth? is ids the source of truth? who
knows? what does truth even mean?), but show an error reflecting what
the caller actually tried (they passed in an invalid id, not a null
string)
2026-09-08 14:04:10 +02:00
bfredl
97660307f5 fix(strings): non fatal errors for [NULL] safety in vim_snprintf
context: vim_snprintf provides a "portable" replacement for a system
vsnprintf(). However we rely on system vsnprintf() in places. This
is quite arbitrary. I want to use system vsnprintf() only, and
reduce the machinery in string.c for typval printf only, which will
delet a lot of duplicated code.

The biggest hurdle here is not "portably" (we only support sane c
runtimes) but the following discrepancy: standard libc printf()
considers NULL args to %s to be undefined behavior strictly
while vim_snprintf() _defacto_ allows this by replacement to "[NULL]"

IMO, this should be seen as "graceful" error handling (nicer than crashing
on the user), not a valid means to have the string "[NULL]" intentionally
be shoved in the users face. more robust code should explicitly
check for NULL and replace it with a _appropriate_ fallback for
the situation, depending on what a NULL string actually means in the
context (unnamed buffer? anonymous namespace? global augroup?)

soo, this PR provides the most _gently_ incremental nudge towards
considering this case again as an error one could possible imagine.
If sanitizers are complied in, this minor incursion gets printed
into the sanitizers' log as a "report-and-continue" error with a
traceback. This doesn't annoy the end user or "stop the world"
in the test suite, but the CI will see the reported error and
fail the build, just like other non-fatal CI errors.
2026-09-08 12:46:24 +02:00
glepnir
b3bd442c5c fix(lsp): completion dynamicRegistration breaks capability readers #41771
Problem:
A server that supports dynamic registration must not also declare
completionProvider at initialize, so server_capabilities.completionProvider
is nil for anything reading it directly.

Solution:
Do not advertise it by default. A client that follows a registration can
declare it itself.
2026-09-08 05:48:38 -04:00
zeertzjq
03f5f25a1e fix(tui): don't treat ESC preceding repeat/release as ALT (#41770) 2026-09-08 17:25:35 +08:00
Yanuo Ma
b781e95a24 fix(scrollbind): window jumps back and forth with tall virt_lines block
Problem:
Scrolling a 'scrollbind' window whose peer has a virt_lines block
taller than the window makes the peer jump back and forth.

Solution:
After scrollup()/scrolldown(), sync w_scbind_pos to the actual
get_vtopline() when the target was not clamped to buffer bounds.

Ref: esmuellert/codediff.nvim#519
AI-assisted
2026-09-08 09:55:15 +01:00
Volodymyr Chernetskyi
8d5ebdf986 fix(lsp): announce typeHierarchy and executeCommand capabilities #41762
Problem:
Type hierarchy (#28388, #28467) and `workspace/executeCommand` (#11607) are
implemented, but `textDocument.typeHierarchy` and `workspace.executeCommand`
are missing from `make_client_capabilities()`.

Solution:
Declare both capabilities.

AI-assisted
2026-09-07 15:11:00 -04:00
Justin M. Keyes
83d1915744 Merge #41708 from janlazo/na-patch-v901
build(vim-patch): n/a patches since Vim version v9.1
2026-09-07 15:10:24 -04:00
Jan Edmund Lazo
cb81d878a2 build(vim-patch): de10c87bed5a79ed80f1bb428a391faefdff13c9 is almost n/a
Vim desktop files are N/A.
"src/po/zh_CN.UTF-8.po" is applicable.
2026-09-07 13:37:41 -04:00
Jan Edmund Lazo
53b372d443 build(vim-patch): n/a patches for src/po/
"vim.pot" file and tasks are N/A.
"clean" task is N/A after migrating to CMake.

N/A patches:
- 59bd74ed4c9ab366182c93bdc430b186729abbad
- 5d552d652b0197063565ab937d30f92a9ed28545
- 3c8d32e4fc17b4b38b17d7c039ee6203d1b01078
2026-09-07 13:37:34 -04:00
Jan Edmund Lazo
e475939fcf build(vim-patch): 015c84ce541495fad568c66b0dd17faefe1c1389 is n/a 2026-09-07 13:37:34 -04:00
Jan Edmund Lazo
552fb90f74 build(vim-patch): v9.1.0681 should be auto-n/a
Vim screendump files and Vim9script screendump code are N/A.
vim-patch.sh cannot auto-N/A the entire patch
because of "src/testdir/README.txt".
2026-09-07 13:37:33 -04:00
Volodymyr Chernetskyi
9f425311c3 fix(lsp): semantic tokens ignore 'fileformat' when sizing line endings #41733
Problem:
The eol_offset used to decode multiline semantic tokens is computed as

    vim.bo.fileformat[bufnr] == 'dos' and 2 or 1

which indexes the option value rather than the buffer, so it is never
"dos" and the offset is always 1. A token that crosses a line boundary
in a 'fileformat' of "dos" is then decoded one code unit short per line
ending, and the highlight extends past the end of the token.

Solution:
Read the option with the buffer-scoped form, vim.bo[bufnr].fileformat.

The existing multiline test covers both formats now. Its token length of
82 counts the line endings it spans, so the same token reaches four
characters less far once the buffer is "dos".

AI-assisted
2026-09-07 12:47:48 -04:00
Volodymyr Chernetskyi
ce5e230af8 fix(lsp): show_document() reports a failed buffer load #41731
Problem:
vim.lsp.util.show_document() can fail to load the target buffer, most
visibly with E325 when another process owns the file's swapfile and the
user declines to open it. The Vim error escapes show_document() and
surfaces inside whichever LSP handler called it, instead of being
reported as a failure to show the document.

Solution:
Load the buffer up front with vim.fn.bufload(), before any of that
state is touched, and report the error instead of raising.

AI-assisted
2026-09-07 16:21:11 +00:00