summaryrefslogtreecommitdiff
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-07-26 20:58:42 +0000
committerBram Moolenaar <Bram@vim.org>2007-07-26 20:58:42 +0000
commit6ee10162b24109d5b3a0558304c110ffc9dc25b7 (patch)
tree499b2caf889484c944c88eafc6a7c5f7c73838cb /src/structs.h
parentf621048b53fb2ac84608886102b1733d7a338708 (diff)
downloadvim-6ee10162b24109d5b3a0558304c110ffc9dc25b7.zip
updated for version 7.1-040
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h40
1 files changed, 37 insertions, 3 deletions
diff --git a/src/structs.h b/src/structs.h
index d531f4e35..c85fc05e5 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1694,6 +1694,41 @@ struct frame_S
#define FR_COL 2 /* frame with a column of windows */
/*
+ * Struct used for highlighting 'hlsearch' matches, matches defined by
+ * ":match" and matches defined by match functions.
+ * For 'hlsearch' there is one pattern for all windows. For ":match" and the
+ * match functions there is a different pattern for each window.
+ */
+typedef struct
+{
+ regmmatch_T rm; /* points to the regexp program; contains last found
+ match (may continue in next line) */
+ buf_T *buf; /* the buffer to search for a match */
+ linenr_T lnum; /* the line to search for a match */
+ int attr; /* attributes to be used for a match */
+ int attr_cur; /* attributes currently active in win_line() */
+ linenr_T first_lnum; /* first lnum to search for multi-line pat */
+ colnr_T startcol; /* in win_line() points to char where HL starts */
+ colnr_T endcol; /* in win_line() points to char where HL ends */
+} match_T;
+
+/*
+ * matchitem_T provides a linked list for storing match items for ":match" and
+ * the match functions.
+ */
+typedef struct matchitem matchitem_T;
+struct matchitem
+{
+ matchitem_T *next;
+ int id; /* match ID */
+ int priority; /* match priority */
+ char_u *pattern; /* pattern to highlight */
+ int hlg_id; /* highlight group ID */
+ regmmatch_T match; /* regexp program for pattern */
+ match_T hl; /* struct for doing the actual highlighting */
+};
+
+/*
* Structure which contains all information that belongs to a window
*
* All row numbers are relative to the start of the window, except w_winrow.
@@ -1934,9 +1969,8 @@ struct window_S
#endif
#ifdef FEAT_SEARCH_EXTRA
- regmmatch_T w_match[3]; /* regexp programs for ":match" */
- char_u *(w_match_pat[3]); /* patterns for ":match" */
- int w_match_id[3]; /* highlight IDs for ":match" */
+ matchitem_T *w_match_head; /* head of match list */
+ int w_next_match_id; /* next match ID */
#endif
/*