aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorMatthew Malcomson <hardenedapple@gmail.com>2017-02-28 15:19:45 +0000
committerJustin M. Keyes <justinkz@gmail.com>2017-03-02 00:18:00 +0100
commitb1731fe1b5d7a9b89acb6c2292b1e3e8f9f33544 (patch)
tree5a5afad73c682bb3972f83cea12c99e4b7a8125e /src/nvim/ex_docmd.c
parent689e0daa95fc870e49f3eb2f23cd6a76c392ff7d (diff)
downloadrneovim-b1731fe1b5d7a9b89acb6c2292b1e3e8f9f33544.tar.gz
rneovim-b1731fe1b5d7a9b89acb6c2292b1e3e8f9f33544.tar.bz2
rneovim-b1731fe1b5d7a9b89acb6c2292b1e3e8f9f33544.zip
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.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index ff0df9e51c..87b6959101 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -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 == '+')