diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2022-02-19 22:59:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-19 22:59:15 +0000 |
commit | 8b3799e2c33282bf417ddee15ae71b5aba613c16 (patch) | |
tree | 14a5119b2c0c73c69a424b50461fa98e918299f9 /src/nvim/change.c | |
parent | 439a843b80339d80e788e8382ae91414c3db6dd5 (diff) | |
parent | 9c04285057b70f90ca19cb08a49f96369085d882 (diff) | |
download | rneovim-8b3799e2c33282bf417ddee15ae71b5aba613c16.tar.gz rneovim-8b3799e2c33282bf417ddee15ae71b5aba613c16.tar.bz2 rneovim-8b3799e2c33282bf417ddee15ae71b5aba613c16.zip |
Merge pull request #17460 from seandewar/vim-8.2.4419
vim-patch:8.2.{4403,4418,4419,4422}
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r-- | src/nvim/change.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c index 6ac759d5e0..736867b6d3 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -223,19 +223,20 @@ static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume, long xtra // values for the cursor. // Update the folds for this window. Can't postpone this, because // a following operator might work on the whole fold: ">>dd". - foldUpdate(wp, lnum, lnume + xtra - 1); + linenr_T last = lnume + xtra - 1; // last line after the change + foldUpdate(wp, lnum, last); // The change may cause lines above or below the change to become // included in a fold. Set lnum/lnume to the first/last line that // might be displayed differently. // Set w_cline_folded here as an efficient way to update it when - // inserting lines just above a closed fold. */ + // inserting lines just above a closed fold. bool folded = hasFoldingWin(wp, lnum, &lnum, NULL, false, NULL); if (wp->w_cursor.lnum == lnum) { wp->w_cline_folded = folded; } - folded = hasFoldingWin(wp, lnume, NULL, &lnume, false, NULL); - if (wp->w_cursor.lnum == lnume) { + folded = hasFoldingWin(wp, last, NULL, &last, false, NULL); + if (wp->w_cursor.lnum == last) { wp->w_cline_folded = folded; } |