diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-10-02 07:53:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-02 07:53:41 +0800 |
commit | dd1c613d0b47e818b7a6657f3c4bdeb959199628 (patch) | |
tree | 9fa048c20fb0f182c42c490f0dfa5c8e81ffc082 /src/nvim/buffer_defs.h | |
parent | 01721aaa667f7fe32f5b9fbf7b6fd99cb775de48 (diff) | |
parent | cb310d2901a0eb63721ac5930daaadee91929208 (diff) | |
download | rneovim-dd1c613d0b47e818b7a6657f3c4bdeb959199628.tar.gz rneovim-dd1c613d0b47e818b7a6657f3c4bdeb959199628.tar.bz2 rneovim-dd1c613d0b47e818b7a6657f3c4bdeb959199628.zip |
Merge pull request #20429 from zeertzjq/vim-9.0.0620
vim-patch:9.0.{0620,0622}: matchaddpos() can only add up to 8 matches
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r-- | src/nvim/buffer_defs.h | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index a8834b85aa..1212dffcec 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -984,9 +984,6 @@ 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 @@ -994,29 +991,28 @@ typedef struct { 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. +/// matchitem_T provides a linked list for storing match items for ":match", +/// matchadd() and matchaddpos(). typedef struct matchitem matchitem_T; struct matchitem { - matchitem_T *next; - int id; ///< match ID - int priority; ///< match priority - char *pattern; ///< pattern to highlight - regmmatch_T match; ///< regexp program for pattern - posmatch_T pos; ///< position matches - match_T hl; ///< struct for doing the actual highlighting - int hlg_id; ///< highlight group ID - int conceal_char; ///< cchar for Conceal highlighting + matchitem_T *mit_next; + int mit_id; ///< match ID + int mit_priority; ///< match priority + + // Either a pattern is defined (mit_pattern is not NUL) or a list of + // positions is given (mit_pos is not NULL and mit_pos_count > 0). + char *mit_pattern; ///< pattern to highlight + regmmatch_T mit_match; ///< regexp program for pattern + + llpos_T *mit_pos_array; ///< array of positions + int mit_pos_count; ///< nr of entries in mit_pos + int mit_pos_cur; ///< internal position counter + linenr_T mit_toplnum; ///< top buffer line + linenr_T mit_botlnum; ///< bottom buffer line + + match_T mit_hl; ///< struct for doing the actual highlighting + int mit_hlg_id; ///< highlight group ID + int mit_conceal_char; ///< cchar for Conceal highlighting }; typedef int FloatAnchor; |