Mercurial > vim
changeset 31420:dcd73efec7de v9.0.1043
patch 9.0.1043: macro has confusing name and is duplicated
Commit: https://github.com/vim/vim/commit/c51a376265708e49a46832816077b6dd27d12c0c
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sat Dec 10 10:22:29 2022 +0000
patch 9.0.1043: macro has confusing name and is duplicated
Problem: Macro has confusing name and is duplicated.
Solution: Use one macro with an understandable name. (closes https://github.com/vim/vim/issues/11686)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 10 Dec 2022 11:30:04 +0100 |
parents | 1696a3098ac4 |
children | 8bfc443b5b00 |
files | src/cmdexpand.c src/version.c |
diffstat | 2 files changed, 13 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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 U j = vim_strsize(NameBuff); } else - j = vim_strsize(SHOW_FILE_TEXT(i)); + j = vim_strsize(SHOW_MATCH(i)); if (j > maxlen) maxlen = j; }