diff options
Diffstat (limited to 'src/spellsuggest.c')
-rw-r--r-- | src/spellsuggest.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/spellsuggest.c b/src/spellsuggest.c index 96e7bb634..e2423cd98 100644 --- a/src/spellsuggest.c +++ b/src/spellsuggest.c @@ -3731,9 +3731,6 @@ cleanup_suggestions( int maxscore, int keep) // nr of suggestions to keep { - suggest_T *stp = &SUG(*gap, 0); - int i; - if (gap->ga_len > 0) { // Sort the list. @@ -3744,6 +3741,9 @@ cleanup_suggestions( // displayed. if (gap->ga_len > keep) { + int i; + suggest_T *stp = &SUG(*gap, 0); + for (i = keep; i < gap->ga_len; ++i) vim_free(stp[i].st_word); gap->ga_len = keep; |