vim-patch:8.0.0388

Fix a problem when filtering manually folded lines

When foldMarkAdjustRecurse() is called to adjust folds that start inside
the range of lines that are being moved and end outside that range, it
calculates `amount_after` for its recursive call incorrectly.
The calculation assumes that folds inside the changed range are being
deleted, but this is not always the case.

This means nested folds that start after the changed range of lines are
shifted an incorrect amount.

We fix this by calculating the `amount_after` differently if the folds
inside the changed range are not being deleted.
This commit is contained in:
Matthew Malcomson
2017-02-28 15:19:45 +00:00
committed by Justin M. Keyes
parent 689e0daa95
commit b1731fe1b5
3 changed files with 55 additions and 5 deletions

View File

@@ -3654,10 +3654,10 @@ static linenr_T get_address(exarg_T *eap,
n = 1;
else
n = getdigits(&cmd);
if (addr_type == ADDR_LOADED_BUFFERS || addr_type == ADDR_BUFFERS)
if (addr_type == ADDR_LOADED_BUFFERS || addr_type == ADDR_BUFFERS) {
lnum = compute_buffer_local_count(
addr_type, lnum, (i == '-') ? -1 * n : n);
else {
} else {
// Relative line addressing, need to adjust for folded lines
// now, but only do it after the first address.
if (addr_type == ADDR_LINES && (i == '-' || i == '+')