patch 8.2.2655: The -w command line argument doesn't work
Problem: The -w command line argument doesn't work. Solution: Don't set 'window' when set with the -w argument. (closes #8011)
This commit is contained in:
@ -3365,8 +3365,9 @@ win_new_shellsize(void)
|
|||||||
ui_new_shellsize();
|
ui_new_shellsize();
|
||||||
if (old_Rows != Rows)
|
if (old_Rows != Rows)
|
||||||
{
|
{
|
||||||
// if 'window' uses the whole screen, keep it using that
|
// If 'window' uses the whole screen, keep it using that.
|
||||||
if (p_window == old_Rows - 1 || old_Rows == 0)
|
// 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;
|
p_window = Rows - 1;
|
||||||
old_Rows = Rows;
|
old_Rows = Rows;
|
||||||
shell_new_rows(); // update window sizes
|
shell_new_rows(); // update window sizes
|
||||||
|
|||||||
@ -1045,6 +1045,7 @@ endfunc
|
|||||||
func Test_w_arg()
|
func Test_w_arg()
|
||||||
" Can't catch the output of gvim.
|
" Can't catch the output of gvim.
|
||||||
CheckNotGui
|
CheckNotGui
|
||||||
|
|
||||||
call writefile(["iVim Editor\<Esc>:q!\<CR>"], 'Xscriptin', 'b')
|
call writefile(["iVim Editor\<Esc>:q!\<CR>"], 'Xscriptin', 'b')
|
||||||
if RunVim([], [], '-s Xscriptin -w Xscriptout')
|
if RunVim([], [], '-s Xscriptin -w Xscriptout')
|
||||||
call assert_equal(["iVim Editor\e:q!\r"], readfile('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 assert_equal("Cannot open for script output: \"Xdir\"\n", m)
|
||||||
call delete("Xdir", 'rf')
|
call delete("Xdir", 'rf')
|
||||||
endif
|
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
|
endfunc
|
||||||
|
|
||||||
" Test for the "-s scriptin" argument
|
" Test for the "-s scriptin" argument
|
||||||
|
|||||||
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2655,
|
||||||
/**/
|
/**/
|
||||||
2654,
|
2654,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user