diff --git a/SwiftNeoVim/TextDrawer.m b/SwiftNeoVim/TextDrawer.m index 33e30520..a1345628 100644 --- a/SwiftNeoVim/TextDrawer.m +++ b/SwiftNeoVim/TextDrawer.m @@ -161,15 +161,15 @@ traits |= kCTFontItalicTrait; } + if (traits == 0) { + return CFRetain(_font); + } + NSFont *cachedFont = _fontTraitCache[@(traits)]; if (cachedFont != nil) { return CFRetain(cachedFont); } - if (traits == 0) { - return CFRetain(_font); - } - CTFontRef fontWithTraits = CTFontCreateCopyWithSymbolicTraits((CTFontRef) _font, 0.0, NULL, traits, traits); if (fontWithTraits == NULL) { return CFRetain(_font);