]> granicus.if.org Git - vim/commitdiff
patch 8.2.4133: output of ":scriptnames" goes into the message history v8.2.4133
authorBram Moolenaar <Bram@vim.org>
Tue, 18 Jan 2022 13:34:05 +0000 (13:34 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 18 Jan 2022 13:34:05 +0000 (13:34 +0000)
Problem:    output of ":scriptnames" goes into the message history, while this
            des not happen for other commands, such as ":ls".
Solution:   Use msg_outtrans() instead of smsg(). (closes #9551)

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

index 350813934a9608621a0d9a83350640b8e063de52..159c9fc675ed208c89f8b9fd77cd1369f8b4c848 100644 (file)
@@ -1652,7 +1652,11 @@ ex_scriptnames(exarg_T *eap)
        {
            home_replace(NULL, SCRIPT_ITEM(i)->sn_name,
                                                    NameBuff, MAXPATHL, TRUE);
-           smsg("%3d: %s", i, NameBuff);
+           vim_snprintf((char *)IObuff, IOSIZE, "%3d: %s", i, NameBuff);
+           msg_putchar('\n');
+           msg_outtrans(IObuff);
+           out_flush();            // output one line at a time
+           ui_breakcheck();
        }
 }
 
index 4712d00a452c01543f93778f49da08ee0c455ac0..44ec146666772b643397f3ccfafdf2afbc0cb271 100644 (file)
@@ -23,6 +23,10 @@ func Test_scriptnames()
 
   bwipe
   call delete('Xscripting')
+
+  let msgs = execute('messages')
+  scriptnames
+  call assert_equal(msgs, execute('messages'))
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
index 8b9958a473f97417a7a973bf6cc377a5f96eb3d9..1e9ab2dd964ce4687816bf0d28ca1cae4afc1fd6 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4133,
 /**/
     4132,
 /**/