diff options
Diffstat (limited to 'src/nvim/insexpand.c')
-rw-r--r-- | src/nvim/insexpand.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 50107cdfea..78f400b39d 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -1067,14 +1067,14 @@ static bool pum_enough_matches(void) { // Don't display the popup menu if there are no matches or there is only // one (ignoring the original text). - compl_T *compl = compl_first_match; + compl_T *comp = compl_first_match; int i = 0; do { - if (compl == NULL || (!match_at_original_text(compl) && ++i == 2)) { + if (comp == NULL || (!match_at_original_text(comp) && ++i == 2)) { break; } - compl = compl->cp_next; - } while (!is_first_match(compl)); + comp = comp->cp_next; + } while (!is_first_match(comp)); if (strstr(p_cot, "menuone") != NULL) { return i >= 1; @@ -1138,7 +1138,7 @@ static int ins_compl_build_pum(void) { // Need to build the popup menu list. compl_match_arraysize = 0; - compl_T *compl = compl_first_match; + compl_T *comp = compl_first_match; // If it's user complete function and refresh_always, // do not use "compl_leader" as prefix filter. @@ -1149,13 +1149,13 @@ static int ins_compl_build_pum(void) const int lead_len = compl_leader != NULL ? (int)strlen(compl_leader) : 0; do { - if (!match_at_original_text(compl) + if (!match_at_original_text(comp) && (compl_leader == NULL - || ins_compl_equal(compl, compl_leader, (size_t)lead_len))) { + || ins_compl_equal(comp, compl_leader, (size_t)lead_len))) { compl_match_arraysize++; } - compl = compl->cp_next; - } while (compl != NULL && !is_first_match(compl)); + comp = comp->cp_next; + } while (comp != NULL && !is_first_match(comp)); if (compl_match_arraysize == 0) { return -1; @@ -1172,46 +1172,46 @@ static int ins_compl_build_pum(void) bool did_find_shown_match = false; int cur = -1; int i = 0; - compl = compl_first_match; + comp = compl_first_match; do { - if (!match_at_original_text(compl) + if (!match_at_original_text(comp) && (compl_leader == NULL - || ins_compl_equal(compl, compl_leader, (size_t)lead_len))) { + || ins_compl_equal(comp, compl_leader, (size_t)lead_len))) { if (!shown_match_ok) { - if (compl == compl_shown_match || did_find_shown_match) { + if (comp == compl_shown_match || did_find_shown_match) { // This item is the shown match or this is the // first displayed item after the shown match. - compl_shown_match = compl; + compl_shown_match = comp; did_find_shown_match = true; shown_match_ok = true; } else { // Remember this displayed match for when the // shown match is just below it. - shown_compl = compl; + shown_compl = comp; } cur = i; } - if (compl->cp_text[CPT_ABBR] != NULL) { - compl_match_array[i].pum_text = compl->cp_text[CPT_ABBR]; + if (comp->cp_text[CPT_ABBR] != NULL) { + compl_match_array[i].pum_text = comp->cp_text[CPT_ABBR]; } else { - compl_match_array[i].pum_text = compl->cp_str; + compl_match_array[i].pum_text = comp->cp_str; } - compl_match_array[i].pum_kind = compl->cp_text[CPT_KIND]; - compl_match_array[i].pum_info = compl->cp_text[CPT_INFO]; - if (compl->cp_text[CPT_MENU] != NULL) { - compl_match_array[i++].pum_extra = compl->cp_text[CPT_MENU]; + compl_match_array[i].pum_kind = comp->cp_text[CPT_KIND]; + compl_match_array[i].pum_info = comp->cp_text[CPT_INFO]; + if (comp->cp_text[CPT_MENU] != NULL) { + compl_match_array[i++].pum_extra = comp->cp_text[CPT_MENU]; } else { - compl_match_array[i++].pum_extra = compl->cp_fname; + compl_match_array[i++].pum_extra = comp->cp_fname; } } - if (compl == compl_shown_match) { + if (comp == compl_shown_match) { did_find_shown_match = true; // When the original text is the shown match don't set // compl_shown_match. - if (match_at_original_text(compl)) { + if (match_at_original_text(comp)) { shown_match_ok = true; } @@ -1222,8 +1222,8 @@ static int ins_compl_build_pum(void) shown_match_ok = true; } } - compl = compl->cp_next; - } while (compl != NULL && !is_first_match(compl)); + comp = comp->cp_next; + } while (comp != NULL && !is_first_match(comp)); if (!shown_match_ok) { // no displayed match at all cur = -1; |