mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
fix(treesitter): don't update fold if tree is unchanged
Problem: Folds are opened when the visible range changes even if there are no modifications to the buffer, e.g, when using zM for the first time. If the parsed tree was invalid, on_win re-parses and gets empty tree changes, which triggers fold updates. Solution: Don't update folds in on_changedtree if there are no changes.
This commit is contained in:
parent
1f551e068f
commit
4607807f9f
@ -299,7 +299,9 @@ local function on_changedtree(bufnr, foldinfo, tree_changes)
|
||||
local srow, _, erow = Range.unpack4(change)
|
||||
get_folds_levels(bufnr, foldinfo, srow, erow)
|
||||
end
|
||||
foldupdate(bufnr)
|
||||
if #tree_changes > 0 then
|
||||
foldupdate(bufnr)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user