From: Michael D. Lowis Date: Wed, 21 Mar 2018 02:32:07 +0000 (-0400) Subject: added back in syntax highlighting and fixed coloring of normal text and regions X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=6dfaacb08a3acaae079f84b364ad61104d23a0bf;p=projs%2Ftide.git added back in syntax highlighting and fixed coloring of normal text and regions --- 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;