1
0
forked from aniani/vim

patch 8.0.0933: terminal test tries to start GUI when it's not possible

Problem:    Terminal test tries to start GUI when it's not possible.
Solution:   Check if the GUI can run. (James McCoy, closes #1971)
This commit is contained in:
Bram Moolenaar
2017-08-13 20:26:20 +02:00
parent 4f44b88684
commit 9f0139a2a8
5 changed files with 11 additions and 3 deletions

View File

@@ -215,3 +215,7 @@ func RunVimPiped(before, after, arguments, pipecmd)
endif
return 1
endfunc
func CanRunGui()
return has('gui') && ($DISPLAY != "" || has('gui_running'))
endfunc

View File

@@ -1,6 +1,7 @@
" Tests specifically for the GUI
if !has('gui') || ($DISPLAY == "" && !has('gui_running'))
source shared.vim
if !CanRunGui()
finish
endif

View File

@@ -1,7 +1,8 @@
" Tests specifically for the GUI features/options that need to be set up at
" startup to take effect at runtime.
if !has('gui') || ($DISPLAY == "" && !has('gui_running'))
source shared.vim
if !CanRunGui()
finish
endif

View File

@@ -417,7 +417,7 @@ endfunc
" must be last, we can't go back from GUI to terminal
func Test_zz_terminal_in_gui()
if !has('gui')
if !CanRunGui()
return
endif
gui -f

View File

@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
933,
/**/
932,
/**/