aboutsummaryrefslogtreecommitdiff
path: root/scripts/genmsgpack.lua
diff options
context:
space:
mode:
authorMatthew Malcomson <hardenedapple@gmail.com>2017-02-27 09:46:50 +0000
committerMatthew Malcomson <hardenedapple@gmail.com>2017-03-23 14:37:47 +0000
commitb2b88423aa0087e5d4aaa122e63dffb97f85222f (patch)
tree66db0a33d4855f16b950a7d9d5981aa65efe7132 /scripts/genmsgpack.lua
parent06ed7a189b2c1dca88f307538b9739b989776068 (diff)
downloadrneovim-b2b88423aa0087e5d4aaa122e63dffb97f85222f.tar.gz
rneovim-b2b88423aa0087e5d4aaa122e63dffb97f85222f.tar.bz2
rneovim-b2b88423aa0087e5d4aaa122e63dffb97f85222f.zip
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
Diffstat (limited to 'scripts/genmsgpack.lua')
0 files changed, 0 insertions, 0 deletions