mirror of
https://github.com/neovim/neovim.git
synced 2026-05-05 21:45:05 +00:00
fold: foldMoveRange(): fix :move bug #6534
Closes #6540 In #6221 there was a mistake in calculating which folds need to be re-ordered. When there are no folds after those that have been adjusted, then `move_end` remains 0. This results in reverse_fold_order() swapping folds that have been adjusted with uninitialised folds in the remainder of the grow array. Add a check in foldMoveRange() to account for this case.
This commit is contained in:
committed by
Justin M. Keyes
parent
77a4f8f235
commit
263849b2dd
@@ -232,6 +232,25 @@ a
|
||||
a]], '2,3m0')
|
||||
eq({1, 2, 0, 0, 0}, get_folds())
|
||||
end)
|
||||
it('handles shifting all remaining folds', function()
|
||||
test_move_indent([[
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a
|
||||
a]], '13m7')
|
||||
eq({1, 2, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 2, 1, 0}, get_folds())
|
||||
end)
|
||||
end)
|
||||
it('updates correctly on :read', function()
|
||||
-- luacheck: ignore 621
|
||||
|
||||
Reference in New Issue
Block a user