comparison src/syntax.c @ 9141:d6662acfc3de v7.4.1854

commit https://github.com/vim/vim/commit/d80629cef03cd40b0bf06c402dfe0b720b3bf608 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 28 15:53:53 2016 +0200 patch 7.4.1854 Problem: When setting 'termguicolors' the Ignore highlighting doesn't work. (Charles Campbell) Solution: Handle the color names "fg" and "bg" when the GUI isn't running and no colors are speficied, fall back to black and white.
author Christian Brabandt <cb@256bit.org>
date Sat, 28 May 2016 16:00:06 +0200
parents f129fd3ebd98
children 989d44d35a66
comparison
equal deleted inserted replaced
9140:443e416797f4 9141:d6662acfc3de
8484 if (gui.in_use) 8484 if (gui.in_use)
8485 #endif 8485 #endif
8486 #ifdef FEAT_GUI 8486 #ifdef FEAT_GUI
8487 return gui.norm_pixel; 8487 return gui.norm_pixel;
8488 #endif 8488 #endif
8489 #if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI)
8490 else
8491 #endif
8492 #ifdef FEAT_TERMGUICOLORS 8489 #ifdef FEAT_TERMGUICOLORS
8490 if (cterm_normal_fg_gui_color != (long_u)INVALCOLOR)
8493 return cterm_normal_fg_gui_color; 8491 return cterm_normal_fg_gui_color;
8492 /* Guess that the foreground is black or white. */
8493 return GUI_GET_COLOR((char_u *)(*p_bg == 'l' ? "black" : "white"));
8494 #endif 8494 #endif
8495 } 8495 }
8496 if (STRICMP(name, "bg") == 0 || STRICMP(name, "background") == 0) 8496 if (STRICMP(name, "bg") == 0 || STRICMP(name, "background") == 0)
8497 { 8497 {
8498 #if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI) 8498 #if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI)
8499 if (gui.in_use) 8499 if (gui.in_use)
8500 #endif 8500 #endif
8501 #ifdef FEAT_GUI 8501 #ifdef FEAT_GUI
8502 return gui.back_pixel; 8502 return gui.back_pixel;
8503 #endif 8503 #endif
8504 #if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI)
8505 else
8506 #endif
8507 #ifdef FEAT_TERMGUICOLORS 8504 #ifdef FEAT_TERMGUICOLORS
8505 if (cterm_normal_bg_gui_color != (long_u)INVALCOLOR)
8508 return cterm_normal_bg_gui_color; 8506 return cterm_normal_bg_gui_color;
8507 /* Guess that the background is white or black. */
8508 return GUI_GET_COLOR((char_u *)(*p_bg == 'l' ? "white" : "black"));
8509 #endif 8509 #endif
8510 } 8510 }
8511 8511
8512 return GUI_GET_COLOR(name); 8512 return GUI_GET_COLOR(name);
8513 } 8513 }
8593 && aep->ae_u.cterm.fg_rgb 8593 && aep->ae_u.cterm.fg_rgb
8594 == taep->ae_u.cterm.fg_rgb 8594 == taep->ae_u.cterm.fg_rgb
8595 && aep->ae_u.cterm.bg_rgb 8595 && aep->ae_u.cterm.bg_rgb
8596 == taep->ae_u.cterm.bg_rgb 8596 == taep->ae_u.cterm.bg_rgb
8597 #endif 8597 #endif
8598
8599 ))) 8598 )))
8600 8599
8601 return i + ATTR_OFF; 8600 return i + ATTR_OFF;
8602 } 8601 }
8603 8602