]> git.mdlowis.com Git - projs/tide.git/commitdiff
changed comment color
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 9 Jun 2017 14:41:55 +0000 (10:41 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 9 Jun 2017 14:41:55 +0000 (10:41 -0400)
config.h
lib/colors.c
lib/view.c

index c7b17d652ea692864ff4de3409d62da1ef3cd1d8..b5cb7e2051bb47dce0c4a0f5339caa25a9c297fd 100644 (file)
--- 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
index 9b838336f063a36454694937ee4118b6a8c6cdf8..072847b77927c8d63e46da9226085e0c4cade5cc 100644 (file)
@@ -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;
     }
index bf32960c606fa1750aef1af5a90c2387149b83e6..1e9d17de32ca4a63616a81f6ef0d1bdc9e044cd4 100644 (file)
@@ -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')