diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-06-11 16:34:23 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-06-11 17:00:14 -0400 |
commit | 2644fe5b7c7dd0381543da56b9444bda79f14676 (patch) | |
tree | 5b6bcfc6b64ffb4457a50e1ed5d2871b9511cc38 /src/nvim/spellfile.c | |
parent | 8ebbeee1d0fe8c1fa67a95324ba98fe6a9794519 (diff) | |
download | rneovim-2644fe5b7c7dd0381543da56b9444bda79f14676.tar.gz rneovim-2644fe5b7c7dd0381543da56b9444bda79f14676.tar.bz2 rneovim-2644fe5b7c7dd0381543da56b9444bda79f14676.zip |
vim-patch:8.2.2974: Greek spell checking uses wrong case folding
Problem: Greek spell checking uses wrong case folding.
Solution: Fold capital sigma depending on whether it is at the end of a
word or not. (closes vim/vim#299)
https://github.com/vim/vim/commit/4f135275984722c1b1e9ace72eeeb7ce7e4ec983
Diffstat (limited to 'src/nvim/spellfile.c')
-rw-r--r-- | src/nvim/spellfile.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index 3c125959a9..145cfe4fc6 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -2942,9 +2942,9 @@ static void add_fromto(spellinfo_T *spin, garray_T *gap, char_u *from, char_u *t char_u word[MAXWLEN]; fromto_T *ftp = GA_APPEND_VIA_PTR(fromto_T, gap); - (void)spell_casefold(from, (int)STRLEN(from), word, MAXWLEN); + (void)spell_casefold(curwin, from, (int)STRLEN(from), word, MAXWLEN); ftp->ft_from = getroom_save(spin, word); - (void)spell_casefold(to, (int)STRLEN(to), word, MAXWLEN); + (void)spell_casefold(curwin, to, (int)STRLEN(to), word, MAXWLEN); ftp->ft_to = getroom_save(spin, word); } @@ -3764,7 +3764,7 @@ store_word ( char_u *word, int flags, // extra flags, WF_BANNED int region, // supported region(s) - char_u *pfxlist, // list of prefix IDs or NULL + const char_u *pfxlist, // list of prefix IDs or NULL bool need_affix // only store word with affix ID ) { @@ -3772,25 +3772,28 @@ store_word ( int ct = captype(word, word + len); char_u foldword[MAXWLEN]; int res = OK; - char_u *p; - (void)spell_casefold(word, len, foldword, MAXWLEN); - for (p = pfxlist; res == OK; ++p) { - if (!need_affix || (p != NULL && *p != NUL)) + (void)spell_casefold(curwin, word, len, foldword, MAXWLEN); + for (const char_u *p = pfxlist; res == OK; p++) { + if (!need_affix || (p != NULL && *p != NUL)) { res = tree_add_word(spin, foldword, spin->si_foldroot, ct | flags, - region, p == NULL ? 0 : *p); - if (p == NULL || *p == NUL) + region, p == NULL ? 0 : *p); + } + if (p == NULL || *p == NUL) { break; + } } ++spin->si_foldwcount; if (res == OK && (ct == WF_KEEPCAP || (flags & WF_KEEPCAP))) { - for (p = pfxlist; res == OK; ++p) { - if (!need_affix || (p != NULL && *p != NUL)) + for (const char_u *p = pfxlist; res == OK; p++) { + if (!need_affix || (p != NULL && *p != NUL)) { res = tree_add_word(spin, word, spin->si_keeproot, flags, - region, p == NULL ? 0 : *p); - if (p == NULL || *p == NUL) + region, p == NULL ? 0 : *p); + } + if (p == NULL || *p == NUL) { break; + } } ++spin->si_keepwcount; } |