summaryrefslogtreecommitdiffstats
path: root/src/cmdexpand.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-10 10:22:29 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-10 10:22:29 +0000
commitc51a376265708e49a46832816077b6dd27d12c0c (patch)
tree4bdfc4d59022a30f7c7c307d25bde9d9793d8bd4 /src/cmdexpand.c
parent4ae0057308c59a0dee2b452736366e49a5a98b3a (diff)
patch 9.0.1043: macro has confusing name and is duplicatedv9.0.1043
Problem: Macro has confusing name and is duplicated. Solution: Use one macro with an understandable name. (closes #11686)
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r--src/cmdexpand.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 3e2ecb3738..cc34f296a8 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -35,7 +35,7 @@ static int compl_match_arraysize;
static int compl_startcol;
static int compl_selected;
-#define SHOW_FILE_TEXT(m) (showtail ? showmatches_gettail(matches[m]) : matches[m])
+#define SHOW_MATCH(m) (showtail ? showmatches_gettail(matches[m]) : matches[m])
/*
* Returns TRUE if fuzzy completion is supported for a given cmdline completion
@@ -339,7 +339,7 @@ cmdline_pum_create(
compl_match_array = ALLOC_MULT(pumitem_T, compl_match_arraysize);
for (i = 0; i < numMatches; i++)
{
- compl_match_array[i].pum_text = SHOW_FILE_TEXT(i);
+ compl_match_array[i].pum_text = SHOW_MATCH(i);
compl_match_array[i].pum_info = NULL;
compl_match_array[i].pum_extra = NULL;
compl_match_array[i].pum_kind = NULL;
@@ -489,7 +489,6 @@ win_redr_status_matches(
int match,
int showtail)
{
-#define L_MATCH(m) (showtail ? showmatches_gettail(matches[m]) : matches[m])
int row;
char_u *buf;
int len;
@@ -525,7 +524,7 @@ win_redr_status_matches(
highlight = FALSE;
}
// count 1 for the ending ">"
- clen = status_match_len(xp, L_MATCH(match)) + 3;
+ clen = status_match_len(xp, SHOW_MATCH(match)) + 3;
if (match == 0)
first_match = 0;
else if (match < first_match)
@@ -538,7 +537,7 @@ win_redr_status_matches(
{
// check if match fits on the screen
for (i = first_match; i < match; ++i)
- clen += status_match_len(xp, L_MATCH(i)) + 2;
+ clen += status_match_len(xp, SHOW_MATCH(i)) + 2;
if (first_match > 0)
clen += 2;
// jumping right, put match at the left
@@ -549,7 +548,7 @@ win_redr_status_matches(
clen = 2;
for (i = match; i < num_matches; ++i)
{
- clen += status_match_len(xp, L_MATCH(i)) + 2;
+ clen += status_match_len(xp, SHOW_MATCH(i)) + 2;
if ((long)clen >= Columns)
break;
}
@@ -560,7 +559,7 @@ win_redr_status_matches(
if (add_left)
while (first_match > 0)
{
- clen += status_match_len(xp, L_MATCH(first_match - 1)) + 2;
+ clen += status_match_len(xp, SHOW_MATCH(first_match - 1)) + 2;
if ((long)clen >= Columns)
break;
--first_match;
@@ -581,7 +580,7 @@ win_redr_status_matches(
clen = len;
i = first_match;
- while ((long)(clen + status_match_len(xp, L_MATCH(i)) + 2) < Columns)
+ while ((long)(clen + status_match_len(xp, SHOW_MATCH(i)) + 2) < Columns)
{
if (i == match)
{
@@ -589,7 +588,7 @@ win_redr_status_matches(
selstart_col = clen;
}
- s = L_MATCH(i);
+ s = SHOW_MATCH(i);
// Check for menu separators - replace with '|'
#ifdef FEAT_MENU
emenu = (xp->xp_context == EXPAND_MENUS
@@ -1129,7 +1128,7 @@ showmatches_oneline(
// Expansion was done here, file names are literal.
isdir = mch_isdir(matches[j]);
if (showtail)
- p = SHOW_FILE_TEXT(j);
+ p = SHOW_MATCH(j);
else
{
home_replace(NULL, matches[j], NameBuff, MAXPATHL,
@@ -1140,7 +1139,7 @@ showmatches_oneline(
else
{
isdir = FALSE;
- p = SHOW_FILE_TEXT(j);
+ p = SHOW_MATCH(j);
}
lastlen = msg_outtrans_attr(p, isdir ? dir_attr : 0);
}
@@ -1219,7 +1218,7 @@ showmatches(expand_T *xp, int wildmenu UNUSED)
j = vim_strsize(NameBuff);
}
else
- j = vim_strsize(SHOW_FILE_TEXT(i));
+ j = vim_strsize(SHOW_MATCH(i));
if (j > maxlen)
maxlen = j;
}