diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-12-23 18:17:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-23 18:17:01 +0100 |
commit | dee78a4095a27369e428572f74f7b64bcc5f670e (patch) | |
tree | 4f06de0fd7a5a80d746c2ffaf18cb0719e66cccd /src/nvim/spell.c | |
parent | ec86f4215fc58246998c6017df84206153d0df1a (diff) | |
parent | 5cb7a709e7f60b0e7bcde70a1aa9fea5f060fe0f (diff) | |
download | rneovim-dee78a4095a27369e428572f74f7b64bcc5f670e.tar.gz rneovim-dee78a4095a27369e428572f74f7b64bcc5f670e.tar.bz2 rneovim-dee78a4095a27369e428572f74f7b64bcc5f670e.zip |
Merge #7708 from ZyX-I/hide-container-impl
Diffstat (limited to 'src/nvim/spell.c')
-rw-r--r-- | src/nvim/spell.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c index c837038659..d2b2575f6a 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -3213,26 +3213,25 @@ spell_find_suggest ( // Find suggestions by evaluating expression "expr". static void spell_suggest_expr(suginfo_T *su, char_u *expr) { - list_T *list; - listitem_T *li; int score; const char *p; // The work is split up in a few parts to avoid having to export // suginfo_T. // First evaluate the expression and get the resulting list. - list = eval_spell_expr(su->su_badword, expr); + list_T *const list = eval_spell_expr(su->su_badword, expr); if (list != NULL) { // Loop over the items in the list. - for (li = list->lv_first; li != NULL; li = li->li_next) - if (li->li_tv.v_type == VAR_LIST) { + TV_LIST_ITER(list, li, { + if (TV_LIST_ITEM_TV(li)->v_type == VAR_LIST) { // Get the word and the score from the items. - score = get_spellword(li->li_tv.vval.v_list, &p); + score = get_spellword(TV_LIST_ITEM_TV(li)->vval.v_list, &p); if (score >= 0 && score <= su->su_maxscore) { add_suggestion(su, &su->su_ga, (const char_u *)p, su->su_badlen, score, 0, true, su->su_sallang, false); } } + }); tv_list_unref(list); } |