]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.447 v7.4.447
authorBram Moolenaar <Bram@vim.org>
Fri, 19 Sep 2014 14:04:11 +0000 (16:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 19 Sep 2014 14:04:11 +0000 (16:04 +0200)
Problem:    Spell files from Hunspell may generate a lot of errors.
Solution:   Add the IGNOREEXTRA flag.

runtime/doc/spell.txt
src/spell.c
src/version.c

index 3ffd8932e1ed97fd772a3345e7ee4a2f6e249c3f..e1cc6a593c16608c2c2dd17568e7737989bf7329 100644 (file)
@@ -1058,6 +1058,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 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
 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:
@@ -1111,6 +1114,14 @@ Specifically, the affix flags can be used for:
 - 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*
 
 The CIRCUMFIX flag means a prefix and suffix must be added at the same time.
index 50636421eae664181c808f3535145db29c02256a..1e52dfb26e0000c19c17197879d22ee82b6970c7 100644 (file)
@@ -4841,6 +4841,7 @@ typedef struct afffile_S
     unsigned   af_nosuggest;   /* NOSUGGEST ID */
     int                af_pfxpostpone; /* postpone prefixes without chop string and
                                   without flags */
+    int                af_ignoreextra; /* IGNOREEXTRA present */
     hashtab_T  af_pref;        /* hashtable for prefixes, affheader_T */
     hashtab_T  af_suff;        /* hashtable for suffixes, affheader_T */
     hashtab_T  af_comp;        /* hashtable for compound flags, compitem_T */
@@ -5605,6 +5606,10 @@ spell_read_aff(spin, fname)
            {
                aff->af_pfxpostpone = TRUE;
            }
+           else if (is_aff_rule(items, itemcnt, "IGNOREEXTRA", 1))
+           {
+               aff->af_ignoreextra = TRUE;
+           }
            else if ((STRCMP(items[0], "PFX") == 0
                                              || STRCMP(items[0], "SFX") == 0)
                    && aff_todo == 0
@@ -5712,9 +5717,11 @@ spell_read_aff(spin, fname)
                int             lasti = 5;
 
                /* Myspell allows extra text after the item, but that might
-                * mean mistakes go unnoticed.  Require a comment-starter.
-                * Hunspell uses a "-" item. */
-               if (itemcnt > lasti && *items[lasti] != '#'
+                * mean mistakes go unnoticed.  Require a comment-starter,
+                * unless IGNOREEXTRA is used.  Hunspell uses a "-" item. */
+               if (itemcnt > lasti
+                       && !aff->af_ignoreextra
+                       && *items[lasti] != '#'
                        && (STRCMP(items[lasti], "-") != 0
                                                     || itemcnt != lasti + 1))
                    smsg((char_u *)_(e_afftrailing), fname, lnum, items[lasti]);
index 53fcc8f0df92db6291f621ce90694506294905cc..49505392968c99ca5d08cb12b1fee56cf65792f0 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    447,
 /**/
     446,
 /**/