mirror of
https://github.com/neovim/neovim.git
synced 2026-07-20 08:01:46 +00:00
fix(treesitter): restore highlighting on 32 bit systems #39091
Problem: Treesitter highlighting regressed on 32-bit builds because ranges that should cover the whole buffer were corrupted when passed into Lua.
Solution: Round-trip those range values through Lua and validate them so treesitter sees the same ranges on 32 and 64-bit builds.
(cherry picked from commit 3838a2579e)
This commit is contained in:
committed by
github-actions[bot]
parent
efc136850d
commit
2ea9ed32e4
@@ -90,6 +90,23 @@ describe('treesitter parser API', function()
|
||||
eq(true, exec_lua('return parser:parse()[1] == tree2'))
|
||||
end)
|
||||
|
||||
it('preserves full-document included ranges', function()
|
||||
insert([[
|
||||
local _ = 1
|
||||
]])
|
||||
|
||||
eq(
|
||||
{
|
||||
{ 0, 0, 0, 4294967295, 4294967295, 4294967295 },
|
||||
},
|
||||
exec_lua(function()
|
||||
local parser = vim.treesitter.get_parser(0, 'lua')
|
||||
local tree = parser:parse()[1]
|
||||
return tree:included_ranges(true)
|
||||
end)
|
||||
)
|
||||
end)
|
||||
|
||||
it('respects eol settings when parsing buffer', function()
|
||||
insert([[
|
||||
int main() {
|
||||
|
||||
Reference in New Issue
Block a user