0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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)
This commit is contained in:
Luuk van Baal
2023-05-27 22:22:10 +01:00
committed by Bram Moolenaar
parent 1ba0b9e36f
commit 30805a1aba
5 changed files with 98 additions and 87 deletions

View File

@@ -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;