# HG changeset patch # User Bram Moolenaar # Date 1644417903 -3600 # Node ID fa7ac1e66026840893683c1b2d892586c552ee54 # Parent 5415a1cbfe09ab552a846c8f65a12de614957bfb patch 8.2.4336: using :filter for :scriptnames does not work Commit: https://github.com/vim/vim/commit/769f5895ebfd10535a0ad978f071da8f20178fc6 Author: Bram Moolenaar 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) diff --git a/src/scriptfile.c b/src/scriptfile.c --- 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(); + } } } } diff --git a/src/testdir/test_filter_cmd.vim b/src/testdir/test_filter_cmd.vim --- 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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4336, +/**/ 4335, /**/ 4334,