aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-09-05 20:57:41 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-09-05 20:57:41 -0400
commit3f5482d3251b3bbdc7c4df8a8e64eb3af7e5922c (patch)
treec3703170cc71c81da50b25fd0a8ff24af387d594 /src/nvim/buffer_defs.h
parentd66cd61b79d6d592436c4552dbdddb904dd1c22e (diff)
parentd860ba45e25231ae54c6fd12ecd00dc936780184 (diff)
downloadrneovim-3f5482d3251b3bbdc7c4df8a8e64eb3af7e5922c.tar.gz
rneovim-3f5482d3251b3bbdc7c4df8a8e64eb3af7e5922c.tar.bz2
rneovim-3f5482d3251b3bbdc7c4df8a8e64eb3af7e5922c.zip
Merge pull request #1107 from fmoralesc/matchaddpos
Add matchaddpos()-related vim patches. [vim-patch: 7.4.330, 7.4.334, 7.4.343, 7.4.344, 7.4.362]
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r--src/nvim/buffer_defs.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 3b12925119..de1b0985bb 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -880,6 +880,28 @@ typedef struct {
proftime_T tm; /* for a time limit */
} match_T;
+/// number of positions supported by matchaddpos()
+#define MAXPOSMATCH 8
+
+/// Same as lpos_T, but with additional field len.
+typedef struct
+{
+ linenr_T lnum; ///< line number
+ colnr_T col; ///< column number
+ int len; ///< length: 0 - to the end of line
+} llpos_T;
+
+/// posmatch_T provides an array for storing match items for matchaddpos()
+/// function.
+typedef struct posmatch posmatch_T;
+struct posmatch
+{
+ llpos_T pos[MAXPOSMATCH]; ///< array of positions
+ int cur; ///< internal position counter
+ linenr_T toplnum; ///< top buffer line
+ linenr_T botlnum; ///< bottom buffer line
+};
+
/*
* matchitem_T provides a linked list for storing match items for ":match" and
* the match functions.
@@ -892,6 +914,7 @@ struct matchitem {
char_u *pattern; /* pattern to highlight */
int hlg_id; /* highlight group ID */
regmmatch_T match; /* regexp program for pattern */
+ posmatch_T pos; // position matches
match_T hl; /* struct for doing the actual highlighting */
};