Revision: 18364
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18364&view=rev
Author:   hofman
Date:     2012-01-04 18:24:02 +0000 (Wed, 04 Jan 2012)
Log Message:
-----------
Use different color for syntax highlighting of braces around full item and 
around quoted string values

Modified Paths:
--------------
    trunk/bibdesk/BDSKErrorEditor.m

Modified: trunk/bibdesk/BDSKErrorEditor.m
===================================================================
--- trunk/bibdesk/BDSKErrorEditor.m     2012-01-04 07:36:09 UTC (rev 18363)
+++ trunk/bibdesk/BDSKErrorEditor.m     2012-01-04 18:24:02 UTC (rev 18364)
@@ -424,7 +424,8 @@
     UniChar ch;
     CFIndex lbmark, atmark, percmark;
     
-    NSColor *braceColor = [NSColor blueColor];
+    NSColor *quoteColor = [NSColor blueColor];
+    NSColor *delimColor = [NSColor redColor];
     NSColor *typeColor = [NSColor purpleColor];
     NSColor *quotedColor = [NSColor brownColor];
     NSColor *commentColor = [NSColor grayColor];
@@ -442,7 +443,7 @@
             while(++cnt < length){
                 ch = CFStringGetCharacterFromInlineBuffer(&inlineBuffer, cnt);
                 if(isLeftBrace(ch)){
-                    SetColor(braceColor, cnt, 1);
+                    SetColor(delimColor, cnt, 1);
                     break;
                 }
             }
@@ -450,7 +451,7 @@
             // in fact whitespace is allowed at the end of "comment", but 
harder to check
             if(cnt - atmark == 8 && CFStringCompareWithOptions(string, 
commentString, CFRangeMake(editedRange.location + atmark + 1, 7), 
kCFCompareCaseInsensitive) == kCFCompareEqualTo){
                 braceDepth = 1;
-                SetColor(braceColor, cnt, 1)
+                SetColor(delimColor, cnt, 1)
                 lbmark = cnt + 1;
                 while(++cnt < length){
                     if(isBackslash(ch)){ // ignore escaped braces
@@ -461,7 +462,7 @@
                     if(isRightBrace(ch)){
                         braceDepth--;
                         if(braceDepth == 0){
-                            SetColor(braceColor, cnt, 1);
+                            SetColor(delimColor, cnt, 1);
                             break;
                         }
                     } else if(isLeftBrace(ch)){
@@ -482,7 +483,7 @@
             SetColor(commentColor, percmark, cnt - percmark);
         }else if(isLeftBrace(ch)){
             braceDepth = 1;
-            SetColor(braceColor, cnt, 1)
+            SetColor(quoteColor, cnt, 1)
             lbmark = cnt + 1;
             while(++cnt < length){
                 if(isBackslash(ch)){ // ignore escaped braces
@@ -493,7 +494,7 @@
                 if(isRightBrace(ch)){
                     braceDepth--;
                     if(braceDepth == 0){
-                        SetColor(braceColor, cnt, 1);
+                        SetColor(quoteColor, cnt, 1);
                         break;
                     }
                 } else if(isLeftBrace(ch)){
@@ -503,7 +504,7 @@
             SetColor(quotedColor, lbmark, cnt - lbmark);
         }else if(isDoubleQuote(ch)){
             braceDepth = 1;
-            SetColor(braceColor, cnt, 1)
+            SetColor(quoteColor, cnt, 1)
             lbmark = cnt + 1;
             while(++cnt < length){
                 if(isBackslash(ch)){ // ignore escaped braces
@@ -513,13 +514,13 @@
                 ch = CFStringGetCharacterFromInlineBuffer(&inlineBuffer, cnt);
                 if(isDoubleQuote(ch)){
                     braceDepth--;
-                    SetColor(braceColor, cnt, 1);
+                    SetColor(quoteColor, cnt, 1);
                     break;
                 }
             }
             SetColor(quotedColor, lbmark, cnt - lbmark);
         }else if(isRightBrace(ch)){
-            SetColor(braceColor, cnt, 1);
+            SetColor(delimColor, cnt, 1);
         }else if(isHash(ch)){
             SetColor(hashColor, cnt, 1);
         }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to