From 6dfaacb08a3acaae079f84b364ad61104d23a0bf Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 20 Mar 2018 22:32:07 -0400 Subject: [PATCH] added back in syntax highlighting and fixed coloring of normal text and regions --- lib/colors.c | 4 +--- lib/config.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/colors.c b/lib/colors.c index 34acaca..651c15f 100644 --- a/lib/colors.c +++ b/lib/colors.c @@ -25,7 +25,6 @@ SyntaxSpan* colors_scan(SyntaxSpan* spans, Buf* buf, size_t beg, size_t end) { /* if the engine died, clear all highlights and quit */ if (ChildIn < 0 || !buf->path) return colors_rewind(spans, 0); -#if 0 /* commence the highlighting */ if (beg < end) { write_chunk(buf, beg, end); @@ -35,7 +34,7 @@ SyntaxSpan* colors_scan(SyntaxSpan* spans, Buf* buf, size_t beg, size_t end) { e = read_num(); c = read_num(); if (e > 0 && c > 0) { - c = (c > 15 ? config_get_int(SynNormal + (c >> 4) - 1) : c) & 0xf; + c = (c > 15 ? Colors[SynNormal + (c >> 4) - 1].fg : c); currspan = mkspan(beg+b, beg+e-1, c, currspan); } if (!firstspan) @@ -44,7 +43,6 @@ SyntaxSpan* colors_scan(SyntaxSpan* spans, Buf* buf, size_t beg, size_t end) { fflush(stdout); DataBeg = DataEnd = Buffer; } -#endif return firstspan; } diff --git a/lib/config.c b/lib/config.c index 16bce14..20d600e 100644 --- a/lib/config.c +++ b/lib/config.c @@ -28,7 +28,7 @@ int /* Integer config options */ ClickTime = 500, MaxScanDist = 0, LineNums = ON, - Syntax = OFF, + Syntax = ON, CopyIndent = ON, TrimOnSave = ON, ExpandTabs = ON; -- 2.49.0