aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/message.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-04-29 21:29:44 -0400
committerJames McCoy <jamessan@jamessan.com>2017-04-29 23:48:27 -0400
commitf219657453271f19519148d76536879bec044534 (patch)
treee3dc982477e44401ae1dfae409896ca914a5283a /src/nvim/message.c
parentab50c1fdb73aa58f620491d50c6fcd222d37cb9d (diff)
downloadrneovim-f219657453271f19519148d76536879bec044534.tar.gz
rneovim-f219657453271f19519148d76536879bec044534.tar.bz2
rneovim-f219657453271f19519148d76536879bec044534.zip
vim-patch:7.4.2263
Problem: :filter does not work for many commands. Can only get matching messages. Solution: Make :filter work for :command, :map, :list, :number and :print. Make ":filter!" show non-matching lines. https://github.com/vim/vim/commit/d29459baa61819e59961804ed258efac5733ec70
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r--src/nvim/message.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index c83dfcd63f..057ce75f79 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -1794,8 +1794,12 @@ static void msg_puts_display(const char_u *str, int maxlen, int attr,
/// "pattern".
bool message_filtered(char_u *msg)
{
- return cmdmod.filter_regmatch.regprog != NULL
- && !vim_regexec(&cmdmod.filter_regmatch, msg, (colnr_T)0);
+ if (cmdmod.filter_regmatch.regprog == NULL) {
+ return false;
+ }
+
+ bool match = vim_regexec(&cmdmod.filter_regmatch, msg, (colnr_T)0);
+ return cmdmod.filter_force ? match : !match;
}
/*