aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 22eabc75c1..973d09d065 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -61,6 +61,7 @@ struct hl_group {
scid_T sg_scriptID; ///< script in which the group was last set
// for terminal UIs
int sg_cterm; ///< "cterm=" highlighting attr
+ ///< (combination of \ref HlAttrFlags)
int sg_cterm_fg; ///< terminal fg color number + 1
int sg_cterm_bg; ///< terminal bg color number + 1
bool sg_cterm_bold; ///< bold attr was set for light color
@@ -2893,6 +2894,13 @@ static int syn_regexec(regmmatch_T *rmp, linenr_T lnum, colnr_T col, syn_time_T
pt = profile_start();
}
+ if (rmp->regprog == NULL) {
+ // This can happen if a previous call to vim_regexec_multi() tried to
+ // use the NFA engine, which resulted in NFA_TOO_EXPENSIVE, and
+ // compiling the pattern with the other engine fails.
+ return false;
+ }
+
rmp->rmm_maxcol = syn_buf->b_p_smc;
r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL);