From 9a36337d32481e0324fe85e2b4886e02f8f74a2c Mon Sep 17 00:00:00 2001 From: Jakub Łuczyński Date: Mon, 29 Jan 2018 02:01:16 +0100 Subject: 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) https://github.com/vim/vim/commit/ef8eb0897819099fb00d675afb9bffe1d008c45e --- src/nvim/ex_getln.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 54bbe66620..c4e0827dad 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -4058,12 +4058,12 @@ static int showmatches(expand_T *xp, int wildmenu) msg_start(); /* prepare for paging */ } - if (got_int) - got_int = FALSE; /* only int. the completion, not the cmd line */ - else if (wildmenu) - win_redr_status_matches(xp, num_files, files_found, 0, showtail); - else { - /* find the length of the longest file name */ + if (got_int) { + got_int = false; // only int. the completion, not the cmd line + } else if (wildmenu) { + win_redr_status_matches(xp, num_files, files_found, -1, showtail); + } else { + // find the length of the longest file name maxlen = 0; for (i = 0; i < num_files; ++i) { if (!showtail && (xp->xp_context == EXPAND_FILES -- cgit