mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
fix(treesitter): foldexpr (#22652)
The ranges passed to foldinfo.remove_range were in the wrong order.
This commit is contained in:
parent
773febc460
commit
35799a6629
@ -200,8 +200,9 @@ end
|
||||
local function on_bytes(bufnr, foldinfo, start_row, old_row, new_row)
|
||||
local end_row_old = start_row + old_row
|
||||
local end_row_new = start_row + new_row
|
||||
|
||||
if new_row < old_row then
|
||||
foldinfo:remove_range(end_row_old, end_row_new)
|
||||
foldinfo:remove_range(end_row_new, end_row_old)
|
||||
elseif new_row > old_row then
|
||||
foldinfo:add_range(start_row, end_row_new)
|
||||
vim.schedule(function()
|
||||
|
Loading…
Reference in New Issue
Block a user