]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4336: using :filter for :scriptnames does not work v8.2.4336
authorBram Moolenaar <Bram@vim.org>
Wed, 9 Feb 2022 14:31:05 +0000 (14:31 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 9 Feb 2022 14:31:05 +0000 (14:31 +0000)
Problem:    Using :filter for :scriptnames does not work. (Ben Jackson)
Solution:   Call message_filtered(). (closes #9720)

src/scriptfile.c
src/testdir/test_filter_cmd.vim
src/version.c

index cee3f5440b6887b1dc210cbc58e9ebe12649c1cd..3b9fec1cd51ebeaf510b24760b1d4f9777e99c71 100644 (file)
@@ -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();
+           }
        }
     }
 }
index 1a9ae7b5b0a63f397937d9d54b22eba487402698..7c84a1384f7aef28dc0e47ccbf371bb8e9601183 100644 (file)
@@ -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
index ab53d512003391ffb3779e28d6eb2e19dedce479..824f172642fdfde5d2e2407b6a3b5c2c12d98d11 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4336,
 /**/
     4335,
 /**/