From: Michael D. Lowis Date: Fri, 9 Jun 2017 14:41:55 +0000 (-0400) Subject: changed comment color X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=c84ed92720d6d051cfbdd608afc1042801985961;p=projs%2Ftide.git changed comment color --- diff --git a/config.h b/config.h index c7b17d6..b5cb7e2 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ extern unsigned int ColorPalette[16]; extern char *ShellCmd[], *SedCmd[], *PickFileCmd[], *PickTagCmd[], *OpenCmd[]; extern int CLR_NormalText, CLR_GutterText, CLR_SelectedText, CLR_TagsBkg, CLR_EditBkg, CLR_HorBorder, CLR_VerBorder, CLR_Ruler, CLR_ScrollBkg, - CLR_ThumbBkg, CLR_Cursor; + CLR_ThumbBkg, CLR_Cursor, CLR_Comment; /* OS-Specific Config ******************************************************************************/ @@ -84,14 +84,15 @@ unsigned int ColorPalette[16] = { int CLR_NormalText = COLOR_PAIR(0,4); int CLR_GutterText = COLOR_PAIR(0,3); int CLR_SelectedText = COLOR_PAIR(4,0); -int CLR_TagsBkg = 1; // Background color for the tags region -int CLR_EditBkg = 0; // Background color for the edit region -int CLR_ScrollBkg = 3; // Background color for the scroll region -int CLR_ThumbBkg = 0; // Background color of the scroll thumb -int CLR_HorBorder = 2; // Horizontal border color -int CLR_VerBorder = 2; // Vertical border color -int CLR_Ruler = 1; // Ruler color -int CLR_Cursor = 7; // Cursor color +int CLR_TagsBkg = 1; // Background color for the tags region +int CLR_EditBkg = 0; // Background color for the edit region +int CLR_ScrollBkg = 3; // Background color for the scroll region +int CLR_ThumbBkg = 0; // Background color of the scroll thumb +int CLR_HorBorder = 2; // Horizontal border color +int CLR_VerBorder = 2; // Vertical border color +int CLR_Ruler = 1; // Ruler color +int CLR_Cursor = 7; // Cursor color +int CLR_Comment = 2; // Comment color #undef INCLUDE_DEFS #endif diff --git a/lib/colors.c b/lib/colors.c index 9b83833..072847b 100644 --- a/lib/colors.c +++ b/lib/colors.c @@ -75,9 +75,8 @@ SyntaxSpan* colors_scan(SyntaxDef* syntax, Buf* buf) { for (; off < end && !buf_iseol(buf, off); off++); else if (matches(buf, &off, syntax->comments.multi_beg)) for (; off < end && !matches(buf, &off, syntax->comments.multi_end); off++); - if (start != off) { - spans = mkspan(start, ++off, CLR_Cursor, spans); - } + if (start != off) + spans = mkspan(start, ++off, CLR_Comment, spans); if (!firstspan && spans) firstspan = spans; } diff --git a/lib/view.c b/lib/view.c index bf32960..1e9d17d 100644 --- a/lib/view.c +++ b/lib/view.c @@ -111,9 +111,9 @@ void view_update(View* view, size_t* csrx, size_t* csry) { if (curr) { size_t off = row->off, col = 0; while (col < row->len) { - if (curr->beg <= off && off < curr->end) { + if (curr->beg <= off && off < curr->end && !(row->cols[col].attr & 0xFF00)) { uint32_t attr = row->cols[col].attr; - row->cols[col].attr = (attr & 0xF0) | curr->color; + row->cols[col].attr = (row->cols[col].attr & 0xFF00) | curr->color; } off++, col++; while (col < row->len && row->cols[col].rune == '\0')