Commits

David Keegan committed 958f4f3

*adding Smultron
*changing diff highlighting to match bitbucket

  • Participants
  • Parent commits c6a41c4

Comments (0)

Files changed (2)

Resources/TextEditors.plist

 	</dict>
 	<dict>
 		<key>editorName</key>
+		<string>Smultron</string>
+		<key>editorID</key>
+		<string>org.smultron.Smultron</string>
+	</dict>
+	<dict>
+		<key>editorName</key>
 		<string>SubEthaEdit</string>
 		<key>editorID</key>
 		<string>de.codingmonkeys.SubEthaEdit</string>

Source/SourceHighlighting.m

 
 NSMutableAttributedString* AttributedStringForSourceCode (NSString *code) {
     if (!code) return nil;
-    NSFont *font = [NSFont fontWithName: @"Courier" size: 10.0f];
+    NSFont *font = [NSFont fontWithName: @"Monaco" size: 10.0f];
     NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
     paraStyle.lineBreakMode = NSLineBreakByClipping;
     NSDictionary *attrs = $dict({NSFontAttributeName, font},
 void HighlightDiffs (NSMutableAttributedString* text) {
     static NSDictionary *added, *deleted, *section;
     if (!added)
-        added = $dict({NSForegroundColorAttributeName, 
-            [NSColor colorWithCalibratedHue: 150/360.0f saturation: 1.0f
-                                 brightness: 0.5f alpha: 1.0f]},
-                      {NSBackgroundColorAttributeName, 
-                          [NSColor colorWithCalibratedHue: 150/360.0f saturation: 0.05f
-                                               brightness: 1.0f alpha: 1.0f]} );
+        added = $dict({NSBackgroundColorAttributeName, 
+            [NSColor colorWithCalibratedRed:0.87f green:1.0f 
+                                       blue:0.86f alpha:1.0f]} );
     if (!deleted)
-        deleted = $dict({NSForegroundColorAttributeName, 
-            [NSColor colorWithCalibratedHue: 0.0f saturation: 0.6f
-                                 brightness: 0.8f alpha: 1.0f]},
-                        {NSBackgroundColorAttributeName, 
-                            [NSColor colorWithCalibratedHue: 0.0f saturation: 0.05f
-                                                 brightness: 1.0f alpha: 1.0f]} );
+        deleted = $dict({NSBackgroundColorAttributeName, 
+            [NSColor colorWithCalibratedRed:1.0f green:0.86f 
+                                       blue:0.87f alpha:1.0f]} );
     if (!section)
-        section = $dict({NSForegroundColorAttributeName, [NSColor whiteColor]},
-                        {NSBackgroundColorAttributeName, [NSColor darkGrayColor]} );
+        section = $dict({NSBackgroundColorAttributeName, 
+            [NSColor colorWithDeviceRed:0.87f green:0.91f 
+                                   blue:0.93f alpha:1.0f]} );
     
     [text addAttribute: NSForegroundColorAttributeName
-                 value: [NSColor grayColor] 
+                 value: [NSColor colorWithCalibratedRed:0.25f green:0.25f blue:0.25f alpha:1.0f]
                  range: NSMakeRange(0,text.length)];
+    
     NSUInteger nextStart, firstLineStart=0;
     for (NSUInteger start = 0,lineNo = 0; start < text.length; start=nextStart,lineNo++) {
         NSUInteger end;