aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp_defs.h
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-26 21:28:47 +0800
committerGitHub <noreply@github.com>2022-11-26 21:28:47 +0800
commit7e9981d246a9d46f19dc6283664c229ae2efe727 (patch)
tree71a95ee120f0eb9cf3bcccd91eeaa0cdfc6c2115 /src/nvim/regexp_defs.h
parent84465a8c1583f444d4365b2a70e03cd38ebe7f81 (diff)
downloadrneovim-7e9981d246a9d46f19dc6283664c229ae2efe727.tar.gz
rneovim-7e9981d246a9d46f19dc6283664c229ae2efe727.tar.bz2
rneovim-7e9981d246a9d46f19dc6283664c229ae2efe727.zip
vim-patch:9.0.0951: trying every character position for a match is inefficient (#21198)
Problem: Trying every character position for a match is inefficient. Solution: Use the start position of the match ignoring "\zs". https://github.com/vim/vim/commit/01105b37a108022515d364201767f7f111ec4222 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/regexp_defs.h')
-rw-r--r--src/nvim/regexp_defs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/regexp_defs.h b/src/nvim/regexp_defs.h
index ee32b8d13a..a3b77f295a 100644
--- a/src/nvim/regexp_defs.h
+++ b/src/nvim/regexp_defs.h
@@ -49,6 +49,8 @@ typedef struct {
regprog_T *regprog;
lpos_T startpos[NSUBEXP];
lpos_T endpos[NSUBEXP];
+
+ colnr_T rmm_matchcol; ///< match start without "\zs"
int rmm_ic;
colnr_T rmm_maxcol; /// when not zero: maximum column
} regmmatch_T;
@@ -128,6 +130,8 @@ typedef struct {
regprog_T *regprog;
char *startp[NSUBEXP];
char *endp[NSUBEXP];
+
+ colnr_T rm_matchcol; ///< match start without "\zs"
bool rm_ic;
} regmatch_T;