diff src/structs.h @ 32507:2614026cd259 v9.0.1585

patch 9.0.1585: weird use of static variables for spell checking Commit: https://github.com/vim/vim/commit/30805a1aba0067cf0087f9a0e5c184562433e2e7 Author: Luuk van Baal <luukvbaal@gmail.com> Date: Sat May 27 22:22:10 2023 +0100 patch 9.0.1585: weird use of static variables for spell checking Problem: Weird use of static variables for spell checking. Solution: Move the variables to a structure and pass them from win_update() to win_line(). (Luuk van Baal, closes #12448)
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 May 2023 23:30:03 +0200
parents 5d07e7e9580f
children 2d1eba13035c
line wrap: on
line diff
--- a/src/structs.h
+++ b/src/structs.h
@@ -4870,3 +4870,18 @@ typedef struct
     // message (when it is not NULL).
     char	*os_errbuf;
 } optset_T;
+
+/*
+ * Spell checking variables passed from win_update() to win_line().
+ */
+typedef struct {
+    int		spv_has_spell;	    // drawn window has spell checking
+#ifdef FEAT_SPELL
+    int		spv_unchanged;	    // not updating for changed text
+    int		spv_checked_col;    // column in "checked_lnum" up to
+				    // which there are no spell errors
+    linenr_T	spv_checked_lnum;   // line number for "checked_col"
+    int		spv_cap_col;	    // column to check for Cap word
+    linenr_T	spv_capcol_lnum;    // line number for "cap_col"
+#endif
+} spellvars_T;