0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 7.4.2244

Problem:    Adding pattern to ":oldfiles" is not a generic solution.
Solution:   Add the ":filter /pat/ cmd" command modifier.  Only works for some
            commands right now.
This commit is contained in:
Bram Moolenaar
2016-08-23 23:51:21 +02:00
parent 1b58cdd160
commit 7b668e83d0
12 changed files with 125 additions and 22 deletions

View File

@@ -137,6 +137,11 @@ msg_attr_keep(
int retval;
char_u *buf = NULL;
/* Skip messages not matching ":filter pattern".
* Don't filter when there is an error. */
if (!emsg_on_display && message_filtered(s))
return TRUE;
#ifdef FEAT_EVAL
if (attr == 0)
set_vim_var_string(VV_STATUSMSG, s, -1);
@@ -2149,6 +2154,17 @@ msg_puts_display(
msg_check();
}
/*
* Return TRUE when ":filter pattern" was used and "msg" does not match
* "pattern".
*/
int
message_filtered(char_u *msg)
{
return cmdmod.filter_regmatch.regprog != NULL
&& !vim_regexec(&cmdmod.filter_regmatch, msg, (colnr_T)0);
}
/*
* Scroll the screen up one line for displaying the next message line.
*/