]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1718: dict-completion does not respect region v9.0.1718
authorLemonBoy <thatlemon@gmail.com>
Tue, 15 Aug 2023 21:07:55 +0000 (23:07 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 15 Aug 2023 21:14:30 +0000 (23:14 +0200)
Problem: dict-completion does not respect region
Solution: respect selected region in dict completion

Set do_region to zero as we don't want a complete dump of the matching
words, we want the code to filter them according to the user's selected
region.

closes: #12792
closes: #7025

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
src/spell.c
src/testdir/test_spell.vim
src/version.c

index ef06ab3e06e369fad379a00125a1527bdc1219a9..1f4c60ed82218b17e5d3bad9bd0adbeece1c656d 100644 (file)
@@ -3942,13 +3942,10 @@ spell_dump_compl(
        }
     }
 
-    if (do_region && region_names != NULL)
+    if (do_region && region_names != NULL && pat == NULL)
     {
-       if (pat == NULL)
-       {
-           vim_snprintf((char *)IObuff, IOSIZE, "/regions=%s", region_names);
-           ml_append(lnum++, IObuff, (colnr_T)0, FALSE);
-       }
+       vim_snprintf((char *)IObuff, IOSIZE, "/regions=%s", region_names);
+       ml_append(lnum++, IObuff, (colnr_T)0, FALSE);
     }
     else
        do_region = FALSE;
index 3f7b028bcb7617e27c5840866035f906e36cc438..9eecb1e3f58dd7f7d7b955343bb2047279eece63 100644 (file)
@@ -274,8 +274,7 @@ func Test_compl_with_CTRL_X_CTRL_K_using_spell()
   call assert_equal(['theater'], getline(1, '$'))
   set spelllang=en_gb
   call feedkeys("Stheat\<c-x>\<c-k>\<esc>", 'tnx')
-  " FIXME: commented out, expected theatre bug got theater. See issue #7025.
-  " call assert_equal(['theatre'], getline(1, '$'))
+  call assert_equal(['theatre'], getline(1, '$'))
 
   bwipe!
   set spell& spelllang& dictionary& ignorecase&
index d5d18556a4365c6068350a365ae8d29dd55b38c7..a1cda69cb9452fdcd31ea0f1c0c35da788a17071 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1718,
 /**/
     1717,
 /**/