diff src/structs.h @ 17389:635d7f5010b8 v8.1.1693

patch 8.1.1693: syntax coloring and highlighting is in one big file commit https://github.com/vim/vim/commit/f9cc9f209ede9f15959e4c2351e970477c139614 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 14 21:29:22 2019 +0200 patch 8.1.1693: syntax coloring and highlighting is in one big file Problem: Syntax coloring and highlighting is in one big file. Solution: Move the highlighting to a separate file. (Yegappan Lakshmanan, closes #4674)
author Bram Moolenaar <Bram@vim.org>
date Sun, 14 Jul 2019 21:30:04 +0200
parents 8f44c630c366
children 5462bb963075
line wrap: on
line diff
--- a/src/structs.h
+++ b/src/structs.h
@@ -1000,6 +1000,58 @@ struct syn_state
 #endif // FEAT_SYN_HL
 
 /*
+ * Structure that stores information about a highlight group.
+ * The ID of a highlight group is also called group ID.  It is the index in
+ * the highlight_ga array PLUS ONE.
+ */
+typedef struct
+{
+    char_u	*sg_name;	// highlight group name
+    char_u	*sg_name_u;	// uppercase of sg_name
+    int		sg_cleared;	// "hi clear" was used
+// for normal terminals
+    int		sg_term;	// "term=" highlighting attributes
+    char_u	*sg_start;	// terminal string for start highl
+    char_u	*sg_stop;	// terminal string for stop highl
+    int		sg_term_attr;	// Screen attr for term mode
+// for color terminals
+    int		sg_cterm;	// "cterm=" highlighting attr
+    int		sg_cterm_bold;	// bold attr was set for light color
+    int		sg_cterm_fg;	// terminal fg color number + 1
+    int		sg_cterm_bg;	// terminal bg color number + 1
+    int		sg_cterm_attr;	// Screen attr for color term mode
+// for when using the GUI
+#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
+    guicolor_T	sg_gui_fg;	// GUI foreground color handle
+    guicolor_T	sg_gui_bg;	// GUI background color handle
+#endif
+#ifdef FEAT_GUI
+    guicolor_T	sg_gui_sp;	// GUI special color handle
+    GuiFont	sg_font;	// GUI font handle
+#ifdef FEAT_XFONTSET
+    GuiFontset	sg_fontset;	// GUI fontset handle
+#endif
+    char_u	*sg_font_name;  // GUI font or fontset name
+    int		sg_gui_attr;    // Screen attr for GUI mode
+#endif
+#if defined(FEAT_GUI) || defined(FEAT_EVAL)
+// Store the sp color name for the GUI or synIDattr()
+    int		sg_gui;		// "gui=" highlighting attributes
+    char_u	*sg_gui_fg_name;// GUI foreground color name
+    char_u	*sg_gui_bg_name;// GUI background color name
+    char_u	*sg_gui_sp_name;// GUI special color name
+#endif
+    int		sg_link;	// link to this highlight group ID
+    int		sg_set;		// combination of SG_* flags
+#ifdef FEAT_EVAL
+    sctx_T	sg_script_ctx;	// script in which the group was last set
+#endif
+} hl_group_T;
+
+#define HL_TABLE()	((hl_group_T *)((highlight_ga.ga_data)))
+#define MAX_HL_ID       20000	// maximum value for a highlight ID.
+
+/*
  * Structure shared between syntax.c, screen.c and gui_x11.c.
  */
 typedef struct attr_entry