Skip to content

Commit fb41293

Browse files
committed
Let HTML tool tips use same font as TextMate
The existing code was for TextMate 1.x (and an OS where Monaco was the default fixed width system font).
1 parent 506388e commit fb41293

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Commands/tooltip/TMDHTMLTips.mm

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,9 @@ - (id)init;
5858

5959
webPreferences = [[WebPreferences alloc] initWithIdentifier:TMDTooltipPreferencesIdentifier];
6060
[webPreferences setJavaScriptEnabled:YES];
61-
NSString *fontName = [[NSUserDefaults standardUserDefaults] stringForKey:@"OakTextViewNormalFontName"];
62-
if(fontName == nil)
63-
fontName = @"Monaco";
64-
int fontSize = [[NSUserDefaults standardUserDefaults] integerForKey:@"OakTextViewNormalFontSize"];
65-
if(fontSize == 0)
66-
fontSize = 11;
67-
NSFont* font = [NSFont fontWithName:fontName size:fontSize];
61+
NSString *fontName = [[NSUserDefaults standardUserDefaults] stringForKey:@"fontName"];
62+
int fontSize = [[NSUserDefaults standardUserDefaults] integerForKey:@"fontSize"] ?: 11;
63+
NSFont* font = fontName ? [NSFont fontWithName:fontName size:fontSize] : [NSFont userFixedPitchFontOfSize:fontSize];
6864
[webPreferences setStandardFontFamily:[font familyName]];
6965
[webPreferences setDefaultFontSize:fontSize];
7066
[webPreferences setDefaultFixedFontSize:fontSize];

0 commit comments

Comments
 (0)