Files
neovim/runtime/lua/vim
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
..
2026-09-07 15:33:22 +01:00
2026-09-07 15:33:22 +01:00
2026-09-07 15:33:22 +01:00
2026-09-03 19:17:25 +01:00
2026-09-07 15:33:22 +01:00
2026-09-07 15:33:22 +01:00
2026-09-07 15:33:22 +01:00
2026-01-09 10:07:15 +01:00
2026-09-07 15:33:22 +01:00
2026-09-07 15:33:22 +01:00
2026-09-07 15:33:22 +01:00
2026-09-07 10:53:56 +01:00
2026-09-07 15:33:22 +01:00
2026-09-07 15:33:22 +01:00