patch 9.0.1330: handling new value of an option has a long "else if" chain

Problem:    Handling new value of an option has a long "else if" chain.
Solution:   Use a function pointer. (Yegappan Lakshmanan, closes #12015)
This commit is contained in:
Yegappan Lakshmanan
2023-02-20 12:16:39 +00:00
committed by Bram Moolenaar
parent 997b8a015c
commit af93691b53
37 changed files with 1517 additions and 1509 deletions

View File

@ -1987,7 +1987,7 @@ count_syllables(slang_T *slang, char_u *word)
* Returns NULL if it's OK, an untranslated error message otherwise.
*/
char *
did_set_spelllang(win_T *wp)
parse_spelllang(win_T *wp)
{
garray_T ga;
char_u *splp;
@ -2503,7 +2503,7 @@ spell_reload(void)
{
if (wp->w_p_spell)
{
(void)did_set_spelllang(wp);
(void)parse_spelllang(wp);
break;
}
}
@ -4410,7 +4410,7 @@ did_set_spell_option(int is_spellfile)
FOR_ALL_WINDOWS(wp)
if (wp->w_buffer == curbuf && wp->w_p_spell)
{
errmsg = did_set_spelllang(wp);
errmsg = parse_spelllang(wp);
break;
}
return errmsg;