Skip to content

Commit 0a1a6a1

Browse files
committed
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)
1 parent ff87140 commit 0a1a6a1

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/term.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3365,8 +3365,9 @@ win_new_shellsize(void)
33653365
ui_new_shellsize();
33663366
if (old_Rows != Rows)
33673367
{
3368-
// if 'window' uses the whole screen, keep it using that
3369-
if (p_window == old_Rows - 1 || old_Rows == 0)
3368+
// If 'window' uses the whole screen, keep it using that.
3369+
// Don't change it when set with "-w size" on the command line.
3370+
if (p_window == old_Rows - 1 || (old_Rows == 0 && p_window == 0))
33703371
p_window = Rows - 1;
33713372
old_Rows = Rows;
33723373
shell_new_rows(); // update window sizes

src/testdir/test_startup.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,7 @@ endfunc
10451045
func Test_w_arg()
10461046
" Can't catch the output of gvim.
10471047
CheckNotGui
1048+
10481049
call writefile(["iVim Editor\<Esc>:q!\<CR>"], 'Xscriptin', 'b')
10491050
if RunVim([], [], '-s Xscriptin -w Xscriptout')
10501051
call assert_equal(["iVim Editor\e:q!\r"], readfile('Xscriptout'))
@@ -1060,6 +1061,14 @@ func Test_w_arg()
10601061
call assert_equal("Cannot open for script output: \"Xdir\"\n", m)
10611062
call delete("Xdir", 'rf')
10621063
endif
1064+
1065+
" A number argument sets the 'window' option
1066+
call writefile(["iwindow \<C-R>=&window\<CR>\<Esc>:wq! Xresult\<CR>"], 'Xscriptin', 'b')
1067+
if RunVim([], [], '-s Xscriptin -w 17')
1068+
call assert_equal(["window 17"], readfile('Xresult'))
1069+
call delete('Xresult')
1070+
endif
1071+
call delete('Xscriptin')
10631072
endfunc
10641073

10651074
" Test for the "-s scriptin" argument

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2655,
753755
/**/
754756
2654,
755757
/**/

0 commit comments

Comments
 (0)