Mercurial > vim
comparison src/insexpand.c @ 19888:435726a03481 v8.2.0500
patch 8.2.0500: using the same loop in many places
Commit: https://github.com/vim/vim/commit/aeea72151c31d686bcbb7b06d895006d7363585c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 2 18:50:46 2020 +0200
patch 8.2.0500: using the same loop in many places
Problem: Using the same loop in many places.
Solution: Define more FOR_ALL macros. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5339)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 02 Apr 2020 19:00:05 +0200 |
parents | e7b4fff348dd |
children | aadd1cae2ff5 |
comparison
equal
deleted
inserted
replaced
19887:d03edd8c7e2f | 19888:435726a03481 |
---|---|
2329 listitem_T *li; | 2329 listitem_T *li; |
2330 int dir = compl_direction; | 2330 int dir = compl_direction; |
2331 | 2331 |
2332 // Go through the List with matches and add each of them. | 2332 // Go through the List with matches and add each of them. |
2333 range_list_materialize(list); | 2333 range_list_materialize(list); |
2334 for (li = list->lv_first; li != NULL; li = li->li_next) | 2334 FOR_ALL_LIST_ITEMS(list, li) |
2335 { | 2335 { |
2336 if (ins_compl_add_tv(&li->li_tv, dir) == OK) | 2336 if (ins_compl_add_tv(&li->li_tv, dir) == OK) |
2337 // if dir was BACKWARD then honor it just once | 2337 // if dir was BACKWARD then honor it just once |
2338 dir = FORWARD; | 2338 dir = FORWARD; |
2339 else if (did_emsg) | 2339 else if (did_emsg) |
2511 what_flag = CI_WHAT_ALL; | 2511 what_flag = CI_WHAT_ALL; |
2512 else | 2512 else |
2513 { | 2513 { |
2514 what_flag = 0; | 2514 what_flag = 0; |
2515 range_list_materialize(what_list); | 2515 range_list_materialize(what_list); |
2516 for (item = what_list->lv_first; item != NULL; item = item->li_next) | 2516 FOR_ALL_LIST_ITEMS(what_list, item) |
2517 { | 2517 { |
2518 char_u *what = tv_get_string(&item->li_tv); | 2518 char_u *what = tv_get_string(&item->li_tv); |
2519 | 2519 |
2520 if (STRCMP(what, "mode") == 0) | 2520 if (STRCMP(what, "mode") == 0) |
2521 what_flag |= CI_WHAT_MODE; | 2521 what_flag |= CI_WHAT_MODE; |