aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawline.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2025-01-03 12:36:36 +0100
committerbfredl <bjorn.linse@gmail.com>2025-01-09 11:17:42 +0100
commit33ff546b50f759bd49d9518a94f8c2416848bdd7 (patch)
treead399dd3077e0a3078f922792322eee193dbd77d /src/nvim/drawline.c
parentfa298fd2f4b0c46df434938cbc17467e263cc094 (diff)
downloadrneovim-33ff546b50f759bd49d9518a94f8c2416848bdd7.tar.gz
rneovim-33ff546b50f759bd49d9518a94f8c2416848bdd7.tar.bz2
rneovim-33ff546b50f759bd49d9518a94f8c2416848bdd7.zip
fix(decoration): fix crash when on_lines decor provider modifies marktree
If a "on_lines" callback changes the structure of the marktree, the iterator (which is used for an entire window viewport) might now point to invalid memory. Restore the iterator to the beginning of the line in this case. fixes #29484
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r--src/nvim/drawline.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 3062b0f2a3..d5273ff3d1 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -1051,12 +1051,12 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
}
}
- has_decor = decor_redraw_line(wp, lnum - 1, &decor_state);
-
if (!end_fill) {
- decor_providers_invoke_line(wp, lnum - 1, &has_decor);
+ decor_providers_invoke_line(wp, lnum - 1);
}
+ has_decor = decor_redraw_line(wp, lnum - 1, &decor_state);
+
if (has_decor) {
extra_check = true;
}