mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-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 vim/vim#8011)
0a1a6a1aa4
Cherry-pick Test_w_arg() from patch v8.2.0509.
This commit is contained in:
parent
a177820420
commit
3b04ba7544
@ -7609,8 +7609,9 @@ void win_new_shellsize(void)
|
|||||||
static long old_Columns = 0;
|
static long old_Columns = 0;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -890,6 +890,36 @@ func Test_not_a_term()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
" Test for the "-w scriptout" argument
|
||||||
|
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 delete('Xscriptout')
|
||||||
|
endif
|
||||||
|
call delete('Xscriptin')
|
||||||
|
|
||||||
|
" Test for failing to open the script output file. This test works only when
|
||||||
|
" the language is English.
|
||||||
|
if v:lang == "C" || v:lang =~ '^[Ee]n'
|
||||||
|
call mkdir("Xdir")
|
||||||
|
let m = system(GetVimCommand() .. " -w Xdir")
|
||||||
|
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 starting vim with various names: vim, ex, view, evim, etc.
|
" Test starting vim with various names: vim, ex, view, evim, etc.
|
||||||
func Test_progname()
|
func Test_progname()
|
||||||
CheckUnix
|
CheckUnix
|
||||||
|
Loading…
Reference in New Issue
Block a user