summaryrefslogtreecommitdiffstats
path: root/src/drawscreen.c
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-05-31 18:57:36 +0100
committerBram Moolenaar <Bram@vim.org>2023-05-31 18:57:36 +0100
commite84c773d42e8b6ef0f8ae9b6c7312e0fd47909af (patch)
tree451c2f6769fb90c496219d08413b146d154938cb /src/drawscreen.c
parent68ebcee0237d927dd5386073499162389d4d708a (diff)
patch 9.0.1595: line pointer becomes invalid when using spell checkingv9.0.1595
Problem: Line pointer becomes invalid when using spell checking. Solution: Call ml_get() at the right places. (Luuk van Baal, closes #12456)
Diffstat (limited to 'src/drawscreen.c')
-rw-r--r--src/drawscreen.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c
index 9676f1b0f0..86fec15026 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -2197,12 +2197,10 @@ win_update(win_T *wp)
#ifdef FEAT_SPELL
// Initialize spell related variables for the first drawn line.
CLEAR_FIELD(spv);
- spv.spv_has_spell = spell_check_window(wp);
- if (spv.spv_has_spell)
+ if (spell_check_window(wp))
{
+ spv.spv_has_spell = TRUE;
spv.spv_unchanged = mod_top == 0;
- spv.spv_capcol_lnum = mod_top ? mod_top : lnum;
- spv.spv_cap_col = check_need_cap(wp, spv.spv_capcol_lnum, 0) ? 0 : - 1;
}
#endif
@@ -2464,19 +2462,13 @@ win_update(win_T *wp)
fold_line(wp, fold_count, &win_foldinfo, lnum, row);
++row;
--fold_count;
- linenr_T lnume = lnum + fold_count;
wp->w_lines[idx].wl_folded = TRUE;
- wp->w_lines[idx].wl_lastlnum = lnume;
+ wp->w_lines[idx].wl_lastlnum = lnum + fold_count;
# ifdef FEAT_SYN_HL
did_update = DID_FOLD;
# endif
# ifdef FEAT_SPELL
- // Check if the line after this fold requires a capital.
- if (spv.spv_has_spell && check_need_cap(wp, lnume + 1, 0))
- {
- spv.spv_cap_col = 0;
- spv.spv_capcol_lnum = lnume + 1;
- }
+ spv.spv_capcol_lnum = 0;
# endif
}
else
@@ -2572,6 +2564,9 @@ win_update(win_T *wp)
#ifdef FEAT_SYN_HL
did_update = DID_NONE;
#endif
+#ifdef FEAT_SPELL
+ spv.spv_capcol_lnum = 0;
+#endif
}
if (lnum > buf->b_ml.ml_line_count)