Skip to content

-[MMCoreTextView initWithFrame:] doesn't initialize fontDescent #883

Closed
@jjgod

Description

@jjgod

-[MMCoreTextView initWithFrame:] initializes font but not fontDescent:

// 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];

so it defaults to 0. In the case of the later -setFont: is called with the same pointer as font, then other initialization related to the font won't happen.

- (void)setFont:(NSFont *)newFont
{
    if (!(newFont && font != newFont))
        return;

There are many ways to fix this, a simple way would be just to call [self setFont:[NSFont userFixedPitchFontOfSize:0]] at -initWithFrame:.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions