Mercurial > vim
changeset 32806:7328cddca686 v9.0.1718
patch 9.0.1718: dict-completion does not respect region
Commit: https://github.com/vim/vim/commit/e98fb643ec5f84f9088c8b1434a0bd6ff988dc2d
Author: LemonBoy <thatlemon@gmail.com>
Date: Tue Aug 15 23:07:55 2023 +0200
patch 9.0.1718: dict-completion does not respect region
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 15 Aug 2023 23:15:06 +0200 |
parents | 6556ba799548 |
children | 0582b3b40319 |
files | src/spell.c src/testdir/test_spell.vim src/version.c |
diffstat | 3 files changed, 6 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/spell.c +++ b/src/spell.c @@ -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;
--- a/src/testdir/test_spell.vim +++ b/src/testdir/test_spell.vim @@ -274,8 +274,7 @@ func Test_compl_with_CTRL_X_CTRL_K_using 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&