mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 00:18:33 +00:00
fix(treesitter): don't open fold when o/O adds a line below #28709
Problem: `o`-ing on a folded line opens the fold, because the new line gets the fold level from the above line (level '='), which extends the fold to the new line. `O` has a similar problem when run on the line below a fold. Solution: Use -1 for the added line to get the lower level from the above/below line.
This commit is contained in:
@@ -87,7 +87,7 @@ end
|
||||
---@param srow integer
|
||||
---@param erow integer 0-indexed, exclusive
|
||||
function FoldInfo:add_range(srow, erow)
|
||||
list_insert(self.levels, srow + 1, erow, '=')
|
||||
list_insert(self.levels, srow + 1, erow, -1)
|
||||
list_insert(self.levels0, srow + 1, erow, -1)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user