From 545bd216a186dac277e35e0230115f1e4fdc60ba Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Mon, 29 Jul 2019 07:40:42 -0700 Subject: [PATCH] Use setFont: directly --- src/MacVim/MMCoreTextView.m | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/MacVim/MMCoreTextView.m b/src/MacVim/MMCoreTextView.m index 94295a3b87..1449fe7e2c 100644 --- a/src/MacVim/MMCoreTextView.m +++ b/src/MacVim/MMCoreTextView.m @@ -147,18 +147,13 @@ defaultAdvanceForFont(NSFont *font) } cgLayerLock = [NSLock new]; - // NOTE! It does not matter which font is set here, Vim will set its - // own font on startup anyway. Just set some bogus values. - font = [[NSFont userFixedPitchFontOfSize:0] retain]; - fontDescent = ceil(CTFontGetDescent((CTFontRef)font)); - cellSize.width = cellSize.height = 1; - // NOTE: If the default changes to 'NO' then the intialization of // p_antialias in option.c must change as well. antialias = YES; drawData = [[NSMutableArray alloc] init]; fontCache = [[NSMutableArray alloc] init]; + [self setFont:[NSFont userFixedPitchFontOfSize:0]]; helper = [[MMTextViewHelper alloc] init]; [helper setTextView:self];