Skip to content

Commit 6349e76

Browse files
committed
Moved kDefaultZoomLevel to the SCXcodeMinimap class and added highlighting for comment.doc and comment.doc.keyword.
1 parent e33d98c commit 6349e76

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

SCXcodeMinimap/SCXcodeMinimap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import <Cocoa/Cocoa.h>
1010

11+
const CGFloat kDefaultZoomLevel;
12+
1113
extern NSString *const SCXodeMinimapShowNotification;
1214
extern NSString *const SCXodeMinimapHideNotification;
1315

SCXcodeMinimap/SCXcodeMinimap.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#import "IDESourceCodeEditor.h"
1414
#import "DVTSourceTextView.h"
1515

16+
const CGFloat kDefaultZoomLevel = 0.15f;
17+
1618
static char kAssociatedObjectMinimapViewKey;
1719

1820
static NSString * const IDESourceCodeEditorDidFinishSetupNotification = @"IDESourceCodeEditorDidFinishSetup";

SCXcodeMinimap/SCXcodeMinimapView.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
@class DVTSourceTextView;
1212
@class SCSelectionView;
1313

14-
extern const CGFloat kDefaultZoomLevel;
15-
1614
@interface SCXcodeMinimapView : NSView
1715

1816
- (instancetype)initWithFrame:(NSRect)frameRect

SCXcodeMinimap/SCXcodeMinimapView.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
#import "DVTSourceNodeTypes.h"
1717
#import "DVTFontAndColorTheme.h"
1818

19-
const CGFloat kDefaultZoomLevel = 0.1f;
2019
const CGFloat kBackgroundColorShadowLevel = 0.1f;
2120
const CGFloat kHighlightColorAlphaLevel = 0.3f;
2221

2322
static NSString * const kXcodeSyntaxCommentNodeName = @"xcode.syntax.comment";
23+
static NSString * const kXcodeSyntaxCommentDocNodeName = @"xcode.syntax.comment.doc";
24+
static NSString * const kXcodeSyntaxCommentDocKeywordNodeName = @"xcode.syntax.comment.doc.keyword";
2425
static NSString * const kXcodeSyntaxPreprocessorNodeName = @"xcode.syntax.preprocessor";
2526

2627
static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification";
@@ -121,10 +122,14 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTempor
121122
NSColor *color = [storage colorAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil];
122123
NSColor *backgroundColor = nil;
123124

124-
if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]) {
125+
if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName] ||
126+
currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName] ||
127+
currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName])
128+
{
125129
NSColor *color = [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]];
126130
backgroundColor = [NSColor colorWithCalibratedRed:color.redComponent green:color.greenComponent blue:color.blueComponent alpha:kHighlightColorAlphaLevel];
127-
} else if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) {
131+
} else if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName])
132+
{
128133
NSColor *color = [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]];
129134
backgroundColor = [NSColor colorWithCalibratedRed:color.redComponent green:color.greenComponent blue:color.blueComponent alpha:kHighlightColorAlphaLevel];
130135
}

0 commit comments

Comments
 (0)