neovim/test/functional/normal
Matthew Malcomson b2b88423aa Robustly handle folds during a :move command
In order to re-order marks according to the :move command, do_move()
uses mark_adjust() in a non-standard manner. The non-standard action is
that it moves some marks *past* other marks. This doesn't matter for
marks, but mark_adjust() calls foldMarkAdjust() which simply changes
fold starts and lengths and doesn't have enough information to know that
other folds have to be checked and reordered.

The array of folds for each window are assumed to be in order of
increasing line number, and if this gets broken some folds can get
"lost".

There has been a previous patch to avoid this problem by deleting and
recalculating all folds in the window, but this comes at the cost of
closing all folds when executing :move, and doesn't cover the case of
manual folds.
This patch adds a new function foldMoveRange() specifically for the
:move command that handles reordering folds as well as simply moving
them. Additionally, we allow calling mark_adjust_nofold() that does the
same as mark_adjust() but doesn't affect any fold array.

Calling mark_adjust_nofold() should be done in the same manner as
calling mark_adjust(), but according changes to the fold arrays must be
done seperately by the calling function.

vim-patch:8.0.0457
vim-patch:8.0.0459
vim-patch:8.0.0461
vim-patch:8.0.0465
2017-03-23 14:37:47 +00:00
..
count_spec.lua Correct logic for setting NormalState.toplevel 2016-09-30 07:29:25 -04:00
fold_spec.lua Robustly handle folds during a :move command 2017-03-23 14:37:47 +00:00
K_spec.lua Mark some functional tests as pending in Windows 2016-08-26 08:21:41 +01:00
put_spec.lua test/put_spec: 2x speedup (#6294) 2017-03-18 01:59:51 +01:00
undo_spec.lua undo: :earlier, g-: Set b_u_seq_cur correctly. (#6016) 2017-01-31 05:46:55 +01:00