aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-03-23 20:23:41 +0800
committerGitHub <noreply@github.com>2022-03-23 20:23:41 +0800
commit52fe8eae078b027a04510715cc01b981f6879f8d (patch)
treeb739ca30597b668d87298f654e1be22845678a1e
parentf5a3edb0c0f761a82b22cd1ac193538220fdee95 (diff)
downloadrneovim-52fe8eae078b027a04510715cc01b981f6879f8d.tar.gz
rneovim-52fe8eae078b027a04510715cc01b981f6879f8d.tar.bz2
rneovim-52fe8eae078b027a04510715cc01b981f6879f8d.zip
fix(screen): do not update syntax_last_parsed when drawing folded line (#17826)
-rw-r--r--src/nvim/screen.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 7182e69d08..0194149b1b 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -1545,17 +1545,17 @@ static void win_update(win_T *wp, DecorProviders *providers)
foldinfo.fi_lines ? srow : wp->w_grid.Rows,
mod_top == 0, false, foldinfo, &line_providers);
- wp->w_lines[idx].wl_folded = foldinfo.fi_lines != 0;
- wp->w_lines[idx].wl_lastlnum = lnum;
- did_update = DID_LINE;
-
- if (foldinfo.fi_lines > 0) {
- did_update = DID_FOLD;
+ if (foldinfo.fi_lines == 0) {
+ wp->w_lines[idx].wl_folded = false;
+ wp->w_lines[idx].wl_lastlnum = lnum;
+ did_update = DID_LINE;
+ syntax_last_parsed = lnum;
+ } else {
foldinfo.fi_lines--;
+ wp->w_lines[idx].wl_folded = true;
wp->w_lines[idx].wl_lastlnum = lnum + foldinfo.fi_lines;
+ did_update = DID_FOLD;
}
-
- syntax_last_parsed = lnum;
}
wp->w_lines[idx].wl_lnum = lnum;