]> granicus.if.org Git - vim/commitdiff
patch 8.2.2655: The -w command line argument doesn't work v8.2.2655
authorBram Moolenaar <Bram@vim.org>
Fri, 26 Mar 2021 13:14:18 +0000 (14:14 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 26 Mar 2021 13:14:18 +0000 (14:14 +0100)
Problem:    The -w command line argument doesn't work.
Solution:   Don't set 'window' when set with the -w argument. (closes #8011)

src/term.c
src/testdir/test_startup.vim
src/version.c

index 8ce577ec130272075088f0e0682bf4d9e9922643..ad52d1b315c0def92d26aa3edbbe2df9b66d8708 100644 (file)
@@ -3365,8 +3365,9 @@ win_new_shellsize(void)
        ui_new_shellsize();
     if (old_Rows != Rows)
     {
-       // if 'window' uses the whole screen, keep it using that
-       if (p_window == old_Rows - 1 || old_Rows == 0)
+       // If 'window' uses the whole screen, keep it using that.
+       // Don't change it when set with "-w size" on the command line.
+       if (p_window == old_Rows - 1 || (old_Rows == 0 && p_window == 0))
            p_window = Rows - 1;
        old_Rows = Rows;
        shell_new_rows();       // update window sizes
index ae12f61873da0a48b660c649bedea4bda328ac6d..0817c9e576b6ad5a9e87b6795c1345c63de93417 100644 (file)
@@ -1045,6 +1045,7 @@ endfunc
 func Test_w_arg()
   " Can't catch the output of gvim.
   CheckNotGui
+
   call writefile(["iVim Editor\<Esc>:q!\<CR>"], 'Xscriptin', 'b')
   if RunVim([], [], '-s Xscriptin -w Xscriptout')
     call assert_equal(["iVim Editor\e:q!\r"], readfile('Xscriptout'))
@@ -1060,6 +1061,14 @@ func Test_w_arg()
     call assert_equal("Cannot open for script output: \"Xdir\"\n", m)
     call delete("Xdir", 'rf')
   endif
+
+  " A number argument sets the 'window' option
+  call writefile(["iwindow \<C-R>=&window\<CR>\<Esc>:wq! Xresult\<CR>"], 'Xscriptin', 'b')
+  if RunVim([], [], '-s Xscriptin -w 17')
+    call assert_equal(["window 17"], readfile('Xresult'))
+    call delete('Xresult')
+  endif
+  call delete('Xscriptin')
 endfunc
 
 " Test for the "-s scriptin" argument
index 5e177f09b3e812c22ba3a4adf93a1731a827182b..4cf2c0a886b0c04a19f4378daf09ddd45446c4de 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2655,
 /**/
     2654,
 /**/