0
0
mirror of https://github.com/vim/vim.git synced 2025-07-25 10:54:51 -04:00

patch 8.1.1965: search count message is not displayed when using a mapping

Problem:    The search count message is not displayed when using a mapping.
            (Gary Johnson)
Solution:   Ignore cmd_silent for showing the search count. (Christian
            Brabandt)
This commit is contained in:
Bram Moolenaar 2019-09-02 21:44:59 +02:00
parent c36350bca3
commit 359ad1a6f9
2 changed files with 63 additions and 54 deletions

View File

@ -1351,8 +1351,9 @@ do_search(
pat = p; /* put pat after search command */
}
if ((options & SEARCH_ECHO) && messaging()
&& !cmd_silent && msg_silent == 0)
if ((options & SEARCH_ECHO) && messaging() &&
!msg_silent &&
(!cmd_silent || !shortmess(SHM_SEARCHCOUNT)))
{
char_u *trunc;
char_u off_buf[40];
@ -1362,7 +1363,8 @@ do_search(
msg_start();
// Get the offset, so we know how long it is.
if (spats[0].off.line || spats[0].off.end || spats[0].off.off)
if (!cmd_silent &&
(spats[0].off.line || spats[0].off.end || spats[0].off.off))
{
p = off_buf;
*p++ = dirc;
@ -1383,13 +1385,13 @@ do_search(
else
p = searchstr;
if (!shortmess(SHM_SEARCHCOUNT))
if (!shortmess(SHM_SEARCHCOUNT) || cmd_silent)
{
// Reserve enough space for the search pattern + offset +
// search stat. Use all the space available, so that the
// search state is right aligned. If there is not enough space
// msg_strtrunc() will shorten in the middle.
if (msg_scrolled != 0)
if (msg_scrolled != 0 || cmd_silent)
// Use all the columns.
len = (int)(Rows - msg_row) * Columns - 1;
else
@ -1406,8 +1408,12 @@ do_search(
if (msgbuf != NULL)
{
vim_memset(msgbuf, ' ', len);
msgbuf[0] = dirc;
msgbuf[len - 1] = NUL;
// do not fill the msgbuf buffer, if cmd_silent is set, leave it
// empty for the search_stat feature.
if (!cmd_silent)
{
msgbuf[0] = dirc;
if (enc_utf8 && utf_iscomposing(utf_ptr2char(p)))
{
@ -1427,7 +1433,7 @@ do_search(
msgbuf = trunc;
}
#ifdef FEAT_RIGHTLEFT
#ifdef FEAT_RIGHTLEFT
// The search pattern could be shown on the right in rightleft
// mode, but the 'ruler' and 'showcmd' area use it too, thus
// it would be blanked out again very soon. Show it on the
@ -1454,7 +1460,7 @@ do_search(
vim_memset(msgbuf + pat_len, ' ', r - msgbuf);
}
}
#endif
#endif
msg_outtrans(msgbuf);
msg_clr_eos();
msg_check();
@ -1464,6 +1470,7 @@ do_search(
msg_nowait = TRUE; // don't wait for this message
}
}
}
/*
* If there is a character offset, subtract it from the current
@ -1569,7 +1576,7 @@ do_search(
// Show [1/15] if 'S' is not in 'shortmess'.
if ((options & SEARCH_ECHO)
&& messaging()
&& !(cmd_silent + msg_silent)
&& !msg_silent
&& c != FAIL
&& !shortmess(SHM_SEARCHCOUNT)
&& msgbuf != NULL)

View File

@ -761,6 +761,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1965,
/**/
1964,
/**/