From f92bda1dad462de81ec92134dfa9ba637edc7bb7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 16 Aug 2023 07:12:47 +0800 Subject: vim-patch:9.0.1718: dict-completion does not respect region (#24733) 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: vim/vim#12792 closes: vim/vim#7025 https://github.com/vim/vim/commit/e98fb643ec5f84f9088c8b1434a0bd6ff988dc2d Co-authored-by: LemonBoy --- src/nvim/spell.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/nvim/spell.c b/src/nvim/spell.c index ce0d0dd5de..6725674ca7 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -3260,11 +3260,9 @@ void spell_dump_compl(char *pat, int ic, Direction *dir, int dumpflags_arg) } } - if (do_region && region_names != NULL) { - if (pat == NULL) { - vim_snprintf(IObuff, IOSIZE, "/regions=%s", region_names); - ml_append(lnum++, IObuff, (colnr_T)0, false); - } + if (do_region && region_names != NULL && pat == NULL) { + vim_snprintf(IObuff, IOSIZE, "/regions=%s", region_names); + ml_append(lnum++, IObuff, (colnr_T)0, false); } else { do_region = false; } -- cgit