You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[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:.
On Sat, Jul 27, 2019 at 1:24 AM Yee Cheng Chin ***@***.***> wrote:
I can take a look. Do you have a concrete repro that I can use to validate
this? As in what are the symtoms form this issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#883?email_source=notifications&email_token=AAAAH6P4SSL37LL6XTIPZV3QBQA5LA5CNFSM4HHRWJTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD26HBOI#issuecomment-515666105>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAAH6JHC23GOFZZGSKWEV3QBQA5LANCNFSM4HHRWJTA>
.
On Sun, Jul 28, 2019 at 7:03 AM Arseny Nasokin ***@***.***> wrote:
Just launch MacVim without any .vimrc/.gvimrc on macOS 10.15 beta you will
see this, all the text will be clipped.
… <#m_-318863697324569685_>
this depends on a font
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#883?email_source=notifications&email_token=AAAAH6KRBVNB6B72CESCLGDQBWRLTA5CNFSM4HHRWJTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD267J3I#issuecomment-515765485>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAAH6J4AFFT2RXDMREU7SLQBWRLTANCNFSM4HHRWJTA>
.
I mean the issue with clipping is font-specific. When I set to Menlo, the issue is clearly present, when I set it to Fira Code, clipping is not present. These conditions and outcomes are repeatable even you mix the order.
On Sun, Jul 28, 2019 at 9:02 AM Arseny Nasokin ***@***.***> wrote:
I mean the issue with clipping is font-specific. When I set to Menlo, the
issue is clearly present, when I set it to Fira Code, clipping is not
present. These conditions and outcomes are repeatable even you mix the
order.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#883?email_source=notifications&email_token=AAAAH6OLLY54YFDL7MSDWF3QBW7INA5CNFSM4HHRWJTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD27BPGA#issuecomment-515774360>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAAH6JWBQOX3ZE64M5YPTLQBW7INANCNFSM4HHRWJTA>
.
So you want to say, that guifont setting sets fontDescent to some meaningful value? If yes, why setting Menlo afterFira Code Light I able to observe clipping?
If I'm guessing correctly, this happens in 10.15 because macOS is reusing and caching NSFont objects internally. Previously, we just naively assume setFont will always be called (which is true), and then the font will be different from the initial dummy font. However, it appears that macOS 10.15 will just pass the same NSFont to us (if your vimrc doesn't override the default font), causing the first setFont to early-out and not set up fontDescent properly. I commented on your pull request for further improvements before I want to merge it in.
Activity
jjgod commentedon Jul 26, 2019
Any update?
ychin commentedon Jul 27, 2019
I can take a look. Do you have a concrete repro that I can use to validate this? As in what are the symptoms form this issue?
jjgod commentedon Jul 27, 2019
eirnym commentedon Jul 28, 2019
this depends on a font
jjgod commentedon Jul 28, 2019
eirnym commentedon Jul 28, 2019
I mean the issue with clipping is font-specific. When I set to Menlo, the issue is clearly present, when I set it to Fira Code, clipping is not present. These conditions and outcomes are repeatable even you mix the order.
jjgod commentedon Jul 28, 2019
jjgod commentedon Jul 28, 2019
Most fonts will have a non-zero descender. When
fontDescentis not initialized properly this will defintiely be a problem.eirnym commentedon Jul 28, 2019
So you want to say, that
guifontsetting setsfontDescentto some meaningful value? If yes, why setting Menlo afterFira Code LightI able to observe clipping?jjgod commentedon Jul 28, 2019
I'm sorry, exactly what you do to trigger this? Do you have steps to reproduce this behavior?
As far as I can tell,
https://github.com/macvim-dev/macvim/blob/master/src/MacVim/MMCoreTextView.m#L327
Since it always assigns
fontDescenthere it shouldn't be a problem as long as-setFont:is being called properly every time aguifontchanges.-[MMCoreTextView initWithFrame:] doesn't initialize fontDescent
ychin commentedon Jul 29, 2019
If I'm guessing correctly, this happens in 10.15 because macOS is reusing and caching
NSFontobjects internally. Previously, we just naively assumesetFontwill always be called (which is true), and then the font will be different from the initial dummy font. However, it appears that macOS 10.15 will just pass the sameNSFontto us (if your vimrc doesn't override the default font), causing the firstsetFontto early-out and not set upfontDescentproperly. I commented on your pull request for further improvements before I want to merge it in.jjgod commentedon Jul 29, 2019
Correct. PR updated.