vim-patch:8.0.0528: highlight wrong text when 'wim' includes "longest" (#7927)

Problem:    When 'wildmenu' is set and 'wildmode' has "longest" then the first
            file name is highlighted, even though the text shows the longest
            match.
Solution:   Do not highlight the first match. (LemonBoy, closes vim/vim#1602)

ef8eb08978
This commit is contained in:
Jakub Łuczyński
2018-01-29 02:01:16 +01:00
committed by Marco Hinz
parent 2569fabf04
commit 9a36337d32

View File

@@ -4058,12 +4058,12 @@ static int showmatches(expand_T *xp, int wildmenu)
msg_start(); /* prepare for paging */ msg_start(); /* prepare for paging */
} }
if (got_int) if (got_int) {
got_int = FALSE; /* only int. the completion, not the cmd line */ got_int = false; // only int. the completion, not the cmd line
else if (wildmenu) } else if (wildmenu) {
win_redr_status_matches(xp, num_files, files_found, 0, showtail); win_redr_status_matches(xp, num_files, files_found, -1, showtail);
else { } else {
/* find the length of the longest file name */ // find the length of the longest file name
maxlen = 0; maxlen = 0;
for (i = 0; i < num_files; ++i) { for (i = 0; i < num_files; ++i) {
if (!showtail && (xp->xp_context == EXPAND_FILES if (!showtail && (xp->xp_context == EXPAND_FILES