0
0
mirror of https://github.com/vim/vim.git synced 2025-10-17 07:44:28 -04:00

patch 8.2.5123: using invalid index when looking for spell suggestions

Problem:    Using invalid index when looking for spell suggestions.
Solution:   Do not decrement the index when it is zero.
This commit is contained in:
Bram Moolenaar
2022-06-18 14:09:08 +01:00
parent 0e8e938d49
commit 156d391195
3 changed files with 14 additions and 1 deletions

View File

@@ -1973,7 +1973,8 @@ suggest_trie_walk(
sp->ts_isdiff = (newscore != 0)
? DIFF_YES : DIFF_NONE;
}
else if (sp->ts_isdiff == DIFF_INSERT)
else if (sp->ts_isdiff == DIFF_INSERT
&& sp->ts_fidx > 0)
// When inserting trail bytes don't advance in the
// bad word.
--sp->ts_fidx;