]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.0836: not all :cdo output is visible v8.2.0836
authorBram Moolenaar <Bram@vim.org>
Thu, 28 May 2020 19:30:11 +0000 (21:30 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 28 May 2020 19:30:11 +0000 (21:30 +0200)
Problem:    Not all :cdo output is visible.
Solution:   Reset 'shortmess' temporarily. (Yegappan Lakshmanan, closes #6155)

src/ex_cmds2.c
src/testdir/test_cdo.vim
src/version.c

index a0f383982f39165628430d786725bc006962eac2..cd066f5c6ba6e7d3af6516ea6c0a05d3452a2d2c 100644 (file)
@@ -643,7 +643,13 @@ ex_listdo(exarg_T *eap)
 
                qf_idx = qf_get_cur_idx(eap);
 
+               // Clear 'shm' to avoid that the file message overwrites
+               // any output from the command.
+               p_shm_save = vim_strsave(p_shm);
+               set_option_value((char_u *)"shm", 0L, (char_u *)"", 0);
                ex_cnext(eap);
+               set_option_value((char_u *)"shm", 0L, p_shm_save, 0);
+               vim_free(p_shm_save);
 
                // If jumping to the next quickfix entry fails, quit here
                if (qf_get_cur_idx(eap) == qf_idx)
index 51800a5e6b3be51291f9026a5bb4a915481c766d..dbed7df4ac9f84a48d9d7d6418f7553df13de259 100644 (file)
@@ -8,22 +8,22 @@ func SetUp()
   call writefile(["Line1", "Line2", "Line3"], 'Xtestfile1')
   call writefile(["Line1", "Line2", "Line3"], 'Xtestfile2')
   call writefile(["Line1", "Line2", "Line3"], 'Xtestfile3')
-endfunction
+endfunc
 
 " Remove the files used by the tests
-function TearDown()
+func TearDown()
   call delete('Xtestfile1')
   call delete('Xtestfile2')
   call delete('Xtestfile3')
-endfunction
+endfunc
 
 " Returns the current line in '<filename> <linenum>L <column>C' format
-function GetRuler()
+func GetRuler()
   return expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C'
-endfunction
+endfunc
 
 " Tests for the :cdo and :ldo commands
-function XdoTests(cchar)
+func XdoTests(cchar)
   enew
 
   " Shortcuts for calling the cdo and ldo commands
@@ -132,10 +132,10 @@ function XdoTests(cchar)
   exe XdoCmd
   call assert_equal(['Xtestfile3 3L 1C'], l)
 
-endfunction
+endfunc
 
 " Tests for the :cfdo and :lfdo commands
-function XfdoTests(cchar)
+func XfdoTests(cchar)
   enew
 
   " Shortcuts for calling the cfdo and lfdo commands
@@ -189,16 +189,28 @@ function XfdoTests(cchar)
   exe XfdoCmd
   call assert_equal(['Xtestfile2 2L 5C'], l)
 
-endfunction
+endfunc
 
 " Tests for cdo and cfdo
-function Test_cdo()
+func Test_cdo()
   call XdoTests('c')
   call XfdoTests('c')
-endfunction
+endfunc
 
 " Tests for ldo and lfdo
-function Test_ldo()
+func Test_ldo()
   call XdoTests('l')
   call XfdoTests('l')
-endfunction
+endfunc
+
+" Test for making 'shm' doesn't interfere with the output.
+func Test_cdo_print()
+  enew | only!
+  cgetexpr ["Xtestfile1:1:Line1", "Xtestfile2:1:Line1", "Xtestfile3:1:Line1"]
+  cdo print
+  call assert_equal('Line1', Screenline(&lines))
+  call assert_equal('Line1', Screenline(&lines - 3))
+  call assert_equal('Line1', Screenline(&lines - 6))
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
index 37b363e314566b48bdc3ee7d8ce3733f35406786..a88e478ac8e9e4d9b9da0740e634ee25572e2f72 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    836,
 /**/
     835,
 /**/