mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.447
Problem: Spell files from Hunspell may generate a lot of errors. Solution: Add the IGNOREEXTRA flag. https://code.google.com/p/vim/source/detail?r=v7-4-447
This commit is contained in:
parent
c3de63bfbc
commit
d5bdc709d0
@ -1053,6 +1053,9 @@ this text to start with a "#" so that mistakes don't go unnoticed. Example:
|
|||||||
SFX F 0 in [^i]n # Spion > Spionin ~
|
SFX F 0 in [^i]n # Spion > Spionin ~
|
||||||
SFX F 0 nen in # Bauerin > Bauerinnen ~
|
SFX F 0 nen in # Bauerin > Bauerinnen ~
|
||||||
|
|
||||||
|
However, to avoid lots of errors in affix files written for Myspell, you can
|
||||||
|
add the IGNOREEXTRA flag.
|
||||||
|
|
||||||
Apparently Myspell allows an affix name to appear more than once. Since this
|
Apparently Myspell allows an affix name to appear more than once. Since this
|
||||||
might also be a mistake, Vim checks for an extra "S". The affix files for
|
might also be a mistake, Vim checks for an extra "S". The affix files for
|
||||||
Myspell that use this feature apparently have this flag. Example:
|
Myspell that use this feature apparently have this flag. Example:
|
||||||
@ -1106,6 +1109,14 @@ Specifically, the affix flags can be used for:
|
|||||||
- CIRCUMFIX, as explained just below.
|
- CIRCUMFIX, as explained just below.
|
||||||
|
|
||||||
|
|
||||||
|
IGNOREEXTRA *spell-IGNOREEXTRA*
|
||||||
|
|
||||||
|
Normally Vim gives an error for an extra field that does not start with '#'.
|
||||||
|
This avoids errors going unnoticed. However, some files created for Myspell
|
||||||
|
or Hunspell may contain many entries with an extra field. Use the IGNOREEXTRA
|
||||||
|
flag to avoid lots of errors.
|
||||||
|
|
||||||
|
|
||||||
CIRCUMFIX *spell-CIRCUMFIX*
|
CIRCUMFIX *spell-CIRCUMFIX*
|
||||||
|
|
||||||
The CIRCUMFIX flag means a prefix and suffix must be added at the same time.
|
The CIRCUMFIX flag means a prefix and suffix must be added at the same time.
|
||||||
|
@ -806,6 +806,7 @@ typedef struct afffile_S {
|
|||||||
unsigned af_nosuggest; // NOSUGGEST ID
|
unsigned af_nosuggest; // NOSUGGEST ID
|
||||||
int af_pfxpostpone; // postpone prefixes without chop string and
|
int af_pfxpostpone; // postpone prefixes without chop string and
|
||||||
// without flags
|
// without flags
|
||||||
|
bool af_ignoreextra; // IGNOREEXTRA present
|
||||||
hashtab_T af_pref; // hashtable for prefixes, affheader_T
|
hashtab_T af_pref; // hashtable for prefixes, affheader_T
|
||||||
hashtab_T af_suff; // hashtable for suffixes, affheader_T
|
hashtab_T af_suff; // hashtable for suffixes, affheader_T
|
||||||
hashtab_T af_comp; // hashtable for compound flags, compitem_T
|
hashtab_T af_comp; // hashtable for compound flags, compitem_T
|
||||||
@ -4629,6 +4630,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
|
|||||||
spin->si_nosugfile = true;
|
spin->si_nosugfile = true;
|
||||||
} else if (is_aff_rule(items, itemcnt, "PFXPOSTPONE", 1)) {
|
} else if (is_aff_rule(items, itemcnt, "PFXPOSTPONE", 1)) {
|
||||||
aff->af_pfxpostpone = true;
|
aff->af_pfxpostpone = true;
|
||||||
|
} else if (is_aff_rule(items, itemcnt, "IGNOREEXTRA", 1)) {
|
||||||
|
aff->af_ignoreextra = true;
|
||||||
} else if ((STRCMP(items[0], "PFX") == 0
|
} else if ((STRCMP(items[0], "PFX") == 0
|
||||||
|| STRCMP(items[0], "SFX") == 0)
|
|| STRCMP(items[0], "SFX") == 0)
|
||||||
&& aff_todo == 0
|
&& aff_todo == 0
|
||||||
@ -4692,8 +4695,11 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
|
|||||||
cur_aff->ah_follows = false;
|
cur_aff->ah_follows = false;
|
||||||
|
|
||||||
// Myspell allows extra text after the item, but that might
|
// Myspell allows extra text after the item, but that might
|
||||||
// mean mistakes go unnoticed. Require a comment-starter.
|
// mean mistakes go unnoticed. Require a comment-starter,
|
||||||
if (itemcnt > lasti && *items[lasti] != '#')
|
// unless IGNOREEXTRA is used. Hunspell uses a "-" item.
|
||||||
|
if (itemcnt > lasti
|
||||||
|
&& !aff->af_ignoreextra
|
||||||
|
&& *items[lasti] != '#')
|
||||||
smsg((char_u *)_(e_afftrailing), fname, lnum, items[lasti]);
|
smsg((char_u *)_(e_afftrailing), fname, lnum, items[lasti]);
|
||||||
|
|
||||||
if (STRCMP(items[2], "Y") != 0 && STRCMP(items[2], "N") != 0)
|
if (STRCMP(items[2], "Y") != 0 && STRCMP(items[2], "N") != 0)
|
||||||
|
@ -290,7 +290,7 @@ static int included_patches[] = {
|
|||||||
//450,
|
//450,
|
||||||
//449,
|
//449,
|
||||||
//448 NA
|
//448 NA
|
||||||
//447,
|
447,
|
||||||
//446,
|
//446,
|
||||||
//445,
|
//445,
|
||||||
444,
|
444,
|
||||||
|
Loading…
Reference in New Issue
Block a user