aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-03-04 12:23:04 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-03-04 13:53:09 +0800
commitb7d59649acf43c76cc72b25c04bcae926a40b4fe (patch)
tree34e2b7c7324382eb0058e1dffa2d1baa1ab2ae0d /src
parent808691e3993ee54519229c175fb950cc02261287 (diff)
downloadrneovim-b7d59649acf43c76cc72b25c04bcae926a40b4fe.tar.gz
rneovim-b7d59649acf43c76cc72b25c04bcae926a40b4fe.tar.bz2
rneovim-b7d59649acf43c76cc72b25c04bcae926a40b4fe.zip
fix(redraw): get the line again after evaluating something
Diffstat (limited to 'src')
-rw-r--r--src/nvim/drawline.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index a2ae828f7e..a46f383f64 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -1507,6 +1507,11 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange,
if (statuscol.draw) {
if (statuscol.textp == NULL) {
get_statuscol_str(wp, lnum, wlv.row - startrow - wlv.filler_lines, &statuscol);
+ if (!end_fill) {
+ // Get the line again as evaluating 'statuscolumn' may free it.
+ line = ml_get_buf(wp->w_buffer, lnum, false);
+ ptr = line + v;
+ }
if (wp->w_redr_statuscol) {
break;
}
@@ -1585,6 +1590,10 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange,
wlv.c_extra = NUL;
wlv.c_final = NUL;
wlv.p_extra[wlv.n_extra] = NUL;
+
+ // Get the line again as evaluating 'foldtext' may free it.
+ line = ml_get_buf(wp->w_buffer, lnum, false);
+ ptr = line + v;
}
if (wlv.draw_state == WL_LINE