From bab44ff37c248a593199d9b3e69700800a49fbd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 15 Sep 2014 15:06:59 +0200 Subject: More efficient syntax highlighting, first match wins --- window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'window.c') diff --git a/window.c b/window.c index eb1c8e7..90ddbff 100644 --- a/window.c +++ b/window.c @@ -381,7 +381,8 @@ void window_draw(Win *win) { if (text + match[i][0].rm_so <= cur && cur < text + match[i][0].rm_eo) { /* within matched expression */ - attrs = rule->color.attr; + attrs = rule->color->attr; + break; /* first match wins */ } } } -- cgit v1.2.3