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
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'))
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