]> granicus.if.org Git - vim/commitdiff
patch 8.0.1534: C syntax test fails when using gvim v8.0.1534
authorBram Moolenaar <Bram@vim.org>
Sat, 24 Feb 2018 13:38:51 +0000 (14:38 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 24 Feb 2018 13:38:51 +0000 (14:38 +0100)
Problem:    C syntax test fails when using gvim
Solution:   Force running in a terminal.  Check that 'background' is correct
            even when $COLORFGBG is set.

src/testdir/screendump.vim
src/testdir/test_syntax.vim
src/version.c

index 5131b935ae8e2e484cb826dd81be75ffc08092b2..5ebe60908ba8d478d95a940fbbd929d044be3d13 100644 (file)
@@ -24,7 +24,8 @@ func RunVimInTerminal(arguments, options)
   hi Normal ctermfg=0 ctermbg=15
 
   let cmd = GetVimCommandClean()
-  let cmd .= ' ' . a:arguments
+  " Add -v to have gvim run in the terminal (if possible)
+  let cmd .= ' -v ' . a:arguments
   let buf = term_start(cmd, {'curwin': 1, 'term_rows': 20, 'term_cols': 75})
   call assert_equal([20, 75], term_getsize(buf))
 
index 554ff1620b5e3a0f8eb174526816993136066c17..1969152a20e80fc9d021850a3cea191498bfd3ae 100644 (file)
@@ -527,6 +527,8 @@ endfunc
 " Check highlighting for a small piece of C code with a screen dump.
 func Test_syntax_c()
   " Need to be able to run terminal Vim with 256 colors.
+  " On MS-Windows the console only has 16 colors and the GUI can't run in a
+  " terminal.
   if !has('terminal') || has('win32')
     return
   endif
@@ -551,9 +553,15 @@ func Test_syntax_c()
        \ '  }',
        \ '}',
        \ ], 'Xtest.c')
+  " This makes the default for 'background' use "dark", check that the
+  " response to t_RB corrects it to "light".
+  let $COLORFGBG = '15;0'
+
   let buf = RunVimInTerminal('Xtest.c', {})
   call VerifyScreenDump(buf, 'Test_syntax_c_01')
   call StopVimInTerminal(buf)
 
+  let $COLORFGBG = ''
   call delete('Xtest.c')
 endfun
index 95e5a72ba1df0d6ee9f4440c3e43a98b96d8f528..085e0f9b615ed8964306623e788b58bfae72a5db 100644 (file)
@@ -778,6 +778,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1534,
 /**/
     1533,
 /**/