vim-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 vim/vim#12448)

30805a1aba
This commit is contained in:
Luuk van Baal
2023-05-28 00:12:56 +02:00
parent b46f61ac05
commit 316c877034
3 changed files with 78 additions and 78 deletions

View File

@@ -23,6 +23,17 @@ EXTERN kvec_t(WinExtmark) win_extmark_arr INIT(= KV_INITIAL_VALUE);
EXTERN bool conceal_cursor_used INIT(= false);
// Spell checking variables passed from win_update() to win_line().
typedef struct {
bool spv_has_spell; ///< drawn window has spell checking
bool 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"
} spellvars_T;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "drawline.h.generated.h"
#endif