mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 08:56:29 +00:00
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)
77a849c4b3
This commit is contained in:
@@ -3123,6 +3123,7 @@ spell_find_suggest (
|
|||||||
static bool expr_busy = false;
|
static bool expr_busy = false;
|
||||||
int c;
|
int c;
|
||||||
langp_T *lp;
|
langp_T *lp;
|
||||||
|
bool did_intern = false;
|
||||||
|
|
||||||
// Set the info in "*su".
|
// Set the info in "*su".
|
||||||
memset(su, 0, sizeof(suginfo_T));
|
memset(su, 0, sizeof(suginfo_T));
|
||||||
@@ -3206,15 +3207,17 @@ spell_find_suggest (
|
|||||||
spell_suggest_expr(su, buf + 5);
|
spell_suggest_expr(su, buf + 5);
|
||||||
expr_busy = false;
|
expr_busy = false;
|
||||||
}
|
}
|
||||||
} else if (STRNCMP(buf, "file:", 5) == 0)
|
} else if (STRNCMP(buf, "file:", 5) == 0) {
|
||||||
// Use list of suggestions in a file.
|
// Use list of suggestions in a file.
|
||||||
spell_suggest_file(su, buf + 5);
|
spell_suggest_file(su, buf + 5);
|
||||||
else {
|
} else if (!did_intern) {
|
||||||
// Use internal method.
|
// Use internal method once.
|
||||||
spell_suggest_intern(su, interactive);
|
spell_suggest_intern(su, interactive);
|
||||||
if (sps_flags & SPS_DOUBLE)
|
if (sps_flags & SPS_DOUBLE) {
|
||||||
do_combine = true;
|
do_combine = true;
|
||||||
}
|
}
|
||||||
|
did_intern = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xfree(sps_copy);
|
xfree(sps_copy);
|
||||||
|
Reference in New Issue
Block a user