diff options
author | James McCoy <jamessan@jamessan.com> | 2017-04-29 21:29:44 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-04-29 23:48:27 -0400 |
commit | f219657453271f19519148d76536879bec044534 (patch) | |
tree | e3dc982477e44401ae1dfae409896ca914a5283a /src/nvim/ex_docmd.c | |
parent | ab50c1fdb73aa58f620491d50c6fcd222d37cb9d (diff) | |
download | rneovim-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/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 45a11482d0..2eaf92df00 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1356,6 +1356,13 @@ static char_u * do_one_cmd(char_u **cmdlinep, if (!checkforcmd(&p, "filter", 4) || *p == NUL || ends_excmd(*p)) { break; } + if (*p == '!') { + cmdmod.filter_force = true; + p = skipwhite(p + 1); + if (*p == NUL || ends_excmd(*p)) { + break; + } + } p = skip_vimgrep_pat(p, ®_pat, NULL); if (p == NULL || *p == NUL) { break; @@ -4883,9 +4890,12 @@ static void uc_list(char_u *name, size_t name_len) cmd = USER_CMD_GA(gap, i); a = cmd->uc_argt; - /* Skip commands which don't match the requested prefix */ - if (STRNCMP(name, cmd->uc_name, name_len) != 0) + // Skip commands which don't match the requested prefix and + // commands filtered out. + if (STRNCMP(name, cmd->uc_name, name_len) != 0 + || message_filtered(cmd->uc_name)) { continue; + } /* Put out the title first time */ if (!found) |