tsyn: apply syn_ctx last in syn_highlight() - neatvi - [fork] simple vi-type editor with UTF-8 support
(HTM) git clone git://src.adamsgaard.dk/neatvi
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 077506cd41e5d2770d3314e4b8b4f1ebd402948e
(DIR) parent 8432d2bc6ab1904a6123acd8fa22738786b545af
(HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
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(-)
---
(DIR) 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;
}