aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-01-21 21:52:43 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-01-21 21:59:35 -0500
commit94cb3b4b3513510893bd9ee4afc00223956e9238 (patch)
treea6e1ac7366873b96ae93df960189ab917479e56f /src
parent1607dd071fe1685cf42b0182b8d1d72152af2c40 (diff)
downloadrneovim-94cb3b4b3513510893bd9ee4afc00223956e9238.tar.gz
rneovim-94cb3b4b3513510893bd9ee4afc00223956e9238.tar.bz2
rneovim-94cb3b4b3513510893bd9ee4afc00223956e9238.zip
vim-patch:8.2.2379: do spell suggestions twice if 'spellsuggest' contains number
Problem: Finding spell suggestions twice if 'spellsuggest' contains number. Solution: Only do internal suggestions once. (closes vim/vim#7713) https://github.com/vim/vim/commit/77a849c4b3d73c228013a047913c90834a93b4f6
Diffstat (limited to 'src')
-rw-r--r--src/nvim/spell.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 5714f5e425..6425c9fed5 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -3123,6 +3123,7 @@ spell_find_suggest (
static bool expr_busy = false;
int c;
langp_T *lp;
+ bool did_intern = false;
// Set the info in "*su".
memset(su, 0, sizeof(suginfo_T));
@@ -3206,14 +3207,16 @@ spell_find_suggest (
spell_suggest_expr(su, buf + 5);
expr_busy = false;
}
- } else if (STRNCMP(buf, "file:", 5) == 0)
+ } else if (STRNCMP(buf, "file:", 5) == 0) {
// Use list of suggestions in a file.
spell_suggest_file(su, buf + 5);
- else {
- // Use internal method.
+ } else if (!did_intern) {
+ // Use internal method once.
spell_suggest_intern(su, interactive);
- if (sps_flags & SPS_DOUBLE)
+ if (sps_flags & SPS_DOUBLE) {
do_combine = true;
+ }
+ did_intern = true;
}
}