tsyn: apply syn_ctx last in syn_highlight() - neatvi - [fork] simple vi-type ed… | |
git clone git://src.adamsgaard.dk/neatvi | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 077506cd41e5d2770d3314e4b8b4f1ebd402948e | |
parent 8432d2bc6ab1904a6123acd8fa22738786b545af | |
Author: Ali Gholami Rudi <[email protected]> | |
Date: Mon, 27 Sep 2021 13:18:43 +0330 | |
syn: apply syn_ctx last in syn_highlight() | |
Diffstat: | |
M syn.c | 4 ++-- | |
1 file changed, 2 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/syn.c b/syn.c | |
t@@ -47,8 +47,6 @@ int *syn_highlight(char *ft, char *s) | |
memset(att, 0, n * sizeof(att[0])); | |
if (!rs) | |
return att; | |
- for (i = 0; i < n; i++) | |
- att[i] = syn_ctx; | |
while ((hl = rset_find(rs, s + sidx, LEN(subs) / 2, subs, flg)) >= 0) { | |
int grp = 0; | |
int cend = 1; | |
t@@ -67,6 +65,8 @@ int *syn_highlight(char *ft, char *s) | |
sidx += cend; | |
flg = RE_NOTBOL; | |
} | |
+ for (i = 0; i < n; i++) | |
+ att[i] = syn_merge(att[i], syn_ctx); | |
return att; | |
} | |