]> granicus.if.org Git - vim/commitdiff
patch 8.2.2379: do spell suggestions twice if 'spellsuggest' contains number v8.2.2379
authorBram Moolenaar <Bram@vim.org>
Wed, 20 Jan 2021 20:42:33 +0000 (21:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 20 Jan 2021 20:42:33 +0000 (21:42 +0100)
Problem:    Finding spell suggestions twice if 'spellsuggest' contains number.
Solution:   Only do internal suggestions once.  (closes #7713)

src/spellsuggest.c
src/version.c

index e2423cd98ab6783d85d8aad70946626d88ca0c94..3de9ff2112a820cc28e5ba8a2d1b8415876b2aa4 100644 (file)
@@ -770,6 +770,7 @@ spell_find_suggest(
     int                c;
     int                i;
     langp_T    *lp;
+    int                did_intern = FALSE;
 
     // Set the info in "*su".
     CLEAR_POINTER(su);
@@ -863,12 +864,13 @@ spell_find_suggest(
        else if (STRNCMP(buf, "file:", 5) == 0)
            // Use list of suggestions in a file.
            spell_suggest_file(su, buf + 5);
-       else
+       else if (!did_intern)
        {
-           // Use internal method.
+           // Use internal method once.
            spell_suggest_intern(su, interactive);
            if (sps_flags & SPS_DOUBLE)
                do_combine = TRUE;
+           did_intern = TRUE;
        }
     }
 
index 5668f75546db07a5f5ce9081682fca74e0c2d5e8..2e67f32aeedeecdd77955621222439a7e319e585 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2379,
 /**/
     2378,
 /**/