Mercurial > vim
changeset 27619:fa7ac1e66026 v8.2.4336
patch 8.2.4336: using :filter for :scriptnames does not work
Commit: https://github.com/vim/vim/commit/769f5895ebfd10535a0ad978f071da8f20178fc6
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 9 14:31:05 2022 +0000
patch 8.2.4336: using :filter for :scriptnames does not work
Problem: Using :filter for :scriptnames does not work. (Ben Jackson)
Solution: Call message_filtered(). (closes https://github.com/vim/vim/issues/9720)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 09 Feb 2022 15:45:03 +0100 |
parents | 5415a1cbfe09 |
children | 90001b1f2930 |
files | src/scriptfile.c src/testdir/test_filter_cmd.vim src/version.c |
diffstat | 3 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -1658,10 +1658,13 @@ ex_scriptnames(exarg_T *eap) i, si->sn_state == SN_STATE_NOT_LOADED ? " A" : "", NameBuff); - msg_putchar('\n'); - msg_outtrans(IObuff); - out_flush(); // output one line at a time - ui_breakcheck(); + if (!message_filtered(IObuff)) + { + msg_putchar('\n'); + msg_outtrans(IObuff); + out_flush(); // output one line at a time + ui_breakcheck(); + } } } }
--- a/src/testdir/test_filter_cmd.vim +++ b/src/testdir/test_filter_cmd.vim @@ -190,4 +190,10 @@ func Test_filter_display() bwipe! endfunc +func Test_filter_scriptnames() + let lines = split(execute('filter /test_filter_cmd/ scriptnames'), "\n") + call assert_equal(1, len(lines)) + call assert_match('filter_cmd', lines[0]) +endfunc + " vim: shiftwidth=2 sts=2 expandtab