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
Describe the bug
I noticed that when building the latest master of macvim, font line-heights get weirdly messed up.
I am on macOS Mojave - 10.14.6
Normally I run off the stateful-render branch, but was trying to rebase master into it when I came across the bug. So I tried building master manually to see if it reproed, and it did indeed.
Edit Notes:
I build via github, via this lil custom build script:
#!/bin/bash
make clean
make distclean
./configure --with-features=huge --enable-terminal --enable-rubyinterp --enable-python3interp --enable-perlinterp --enable-cscope --enable-rubyinterp --with-ruby-command=/usr/bin/ruby
make
rm src/MacVim/build/Release/MacVim.app/Contents/Resources/MacVim.icns
cp ./MacVim.icns src/MacVim/build/Release/MacVim.app/Contents/Resources/
open src/MacVim/build/Release
@eirnym I edited my original post with the missing things you requested, however I don't think there's any way this is plugin related, unless a plugin is editing linespace which it's not - since checking the value yields 0, which my older working build had as well.
@ychin I can also confirm downloading the latest release from the releases tab in github also replicates this bug with my font settings, so could be related. Also I don't think stateful-render PR branch has 159 updates yet either, so that seems like a really good candidate.
@amadeus Looking at the commits, I think the stateful-render branch actually contains a temporary bug that was introduced and fixed in between snapshot-157 and snapshot-158 (see #928). (Edit: Interestingly #928 was also complaining about the InputMono font)
Now, it's arguable whether it's a bug or not. Basically MacVim has never respected the font's line heights (try snapshot 157/158 if you don't believe me) and there was a PR which started reading font's line heights, which while sort of correct, introduced a behavior that's different from before. I fixed the issue before releasing 158 to keep it consistent with before.
If we want to support line heights, we could, but it would need to be a new option to keep it consistent with years of existing behavior.
@amadeus feel free to try older versions to see if they behave similar to snapshot-159/160.
Out of curiosity, how do we calculate line height now? Is it simply the font size?
Ideally you guys could expose a guilineheight option to override. It looks like I could customize Input Mono to download it with a 1x line-height - but the font ends up looking VERY tight that way, so the breathing room in stateful-renderer (which i believe is using a 1.2x line height) is good.
Out of curiosity, how do we calculate line height now? Is it simply the font size?
I believe that's the case but I actually haven't looked closely enough. I just fixed it up to make sure we didn't have a regression or incompatible change but I didn't have time to dive into the specifics of how the line height is calculated now.
Ideally you guys could expose a guilineheight option to override. It looks like I could customize Input Mono to download it with a 1x line-height - but the font ends up looking VERY tight that way, so the breathing room in stateful-renderer (which i believe is using a 1.2x line height) is good.
Yeah I agree we could expose an option. It's just that in true Vim fashion we should keep the old behavior which has been around for a while the default.
Maybe we can convince @s4y to make it part of the stateful-render branch 😏
If I was to spec the feature, I would say - guilineheight should default to whatever it does now (for backwards compatibility), but then it could also take a floating point value to override the existing behavior which would then be a multiplier for the existing lineheight. So if the default is 1, then I could specify 1.2 which would be 1.2 * guifontsize == 1.2 * 15 == 18
Maybe we can convince @s4y to make it part of the stateful-render branch 😏
No please don't. Let's just try to merge that first before tacking on small features. I need to review the latest changes in that PR and hopefully this will get in soon.
If I was to spec the feature, I would say - guilineheight should default to whatever it does now (for backwards compatibility), but then it could also take a floating point value to override the existing behavior which would then be a multiplier for the existing lineheight. So if the default is 1, then I could specify 1.2 which would be 1.2 * guifontsize == 1.2 * 15 == 18
Can't you just use linespace for that? I would imagine we just need some way to tell MacVim to respect the font's native line height. It could either be set as part of guifont, a new Vim settings, or just a preference set in the GUI preference panel.
If we want to support line heights, we could, but it would need to be a new option to keep it consistent with years of existing behavior.
I will never understand this line of thinking. It's an editor that has always been broken. Fix it. It's not a legacy bank transaction system. It's an editor. No one is going to lose anything if their editor suddenly starts behaving more rationally. Just fix it, for goodness sake. Why not?
Wish I knew enough to help more practically. Here's some more info that may help.
This bug never used to happen -- like for years, until a couple or three months ago or however long it's been.
Hopefully the following will at least show a way to reliably duplicate the issue on the dev's system.
MacVim's start-up behaviour is different from any other time a font size or family is changed. At start-up, the lines are too short and font is clipped. After making any change to font however, the issues corrects itself. It's so easy to fix / work around (see below) that I just figured the bug would "go away of its own accord." (Wouldn't that be cool? :p) However, it's been months now. So, I guess the bug's presentation is not as prevalent as I have assumed.
Examples ...
% mvim --clean
:option<Cr>
screen snippet
Increase font size +1 then immediately -1 (or any change in font, by any manner)
<cmd +><cmd ->
new screen snippet -- not that lines are "correct" (more appropriate) height now.
Plugins were disabled for this data. Confirming evidence; I usually work on a dark background.
iMac 27" macOS 10.15.4 (19E287)
Bug also present and identical on MacBook Pro, fresh install, 10.15.4 (19E287)
This issue appears to have been fixed in MacVim Version 8.2.539 (163) which came through the automatic updatimathing, for me at around 2020-05-05 10:00 GMT.
Activity
[-]Line Height Issue on lates master[/-][+]Line Height Issue on latest master[/+]eirnym commentedon Oct 28, 2019
@amadeus thank you for an issue
You missed a few important steps of creating bug-report, so please, fill them out.
Could you tell us more about your system?
mvim --clean(gvim --clean) to eliminate influence of all plugins you havedefaults read org.vim.MacVim | grep 'MM\|SU'ychin commentedon Oct 28, 2019
What font are you using? There was some line height issue that I think was fixed in 159 so curious if it’s related.
amadeus commentedon Oct 28, 2019
@ychin my guifont settings are:
https://input.fontbureau.com/
amadeus commentedon Oct 28, 2019
@eirnym I edited my original post with the missing things you requested, however I don't think there's any way this is plugin related, unless a plugin is editing
linespacewhich it's not - since checking the value yields 0, which my older working build had as well.@ychin I can also confirm downloading the latest release from the releases tab in github also replicates this bug with my font settings, so could be related. Also I don't think
stateful-renderPR branch has 159 updates yet either, so that seems like a really good candidate.eirnym commentedon Oct 28, 2019
@ychin it seems to be same as with
Menlo. Spacing between letters are higher.Fira Code Lighthave the same issues, but less visibleychin commentedon Oct 29, 2019
@amadeus Looking at the commits, I think the
stateful-renderbranch actually contains a temporary bug that was introduced and fixed in between snapshot-157 and snapshot-158 (see #928). (Edit: Interestingly #928 was also complaining about the InputMono font)Now, it's arguable whether it's a bug or not. Basically MacVim has never respected the font's line heights (try snapshot 157/158 if you don't believe me) and there was a PR which started reading font's line heights, which while sort of correct, introduced a behavior that's different from before. I fixed the issue before releasing 158 to keep it consistent with before.
If we want to support line heights, we could, but it would need to be a new option to keep it consistent with years of existing behavior.
@amadeus feel free to try older versions to see if they behave similar to snapshot-159/160.
amadeus commentedon Oct 29, 2019
Interesting! I’ll experiment more tomorrow.
Out of curiosity, how do we calculate line height now? Is it simply the font size?
Ideally you guys could expose a
guilineheightoption to override. It looks like I could customize Input Mono to download it with a 1x line-height - but the font ends up looking VERY tight that way, so the breathing room in stateful-renderer (which i believe is using a 1.2x line height) is good.ychin commentedon Oct 30, 2019
I believe that's the case but I actually haven't looked closely enough. I just fixed it up to make sure we didn't have a regression or incompatible change but I didn't have time to dive into the specifics of how the line height is calculated now.
Yeah I agree we could expose an option. It's just that in true Vim fashion we should keep the old behavior which has been around for a while the default.
amadeus commentedon Oct 30, 2019
Maybe we can convince @s4y to make it part of the
stateful-renderbranch 😏If I was to spec the feature, I would say -
guilineheightshould default to whatever it does now (for backwards compatibility), but then it could also take a floating point value to override the existing behavior which would then be a multiplier for the existing lineheight. So if the default is 1, then I could specify 1.2 which would be1.2 * guifontsize==1.2 * 15==18ychin commentedon Oct 30, 2019
No please don't. Let's just try to merge that first before tacking on small features. I need to review the latest changes in that PR and hopefully this will get in soon.
Can't you just use
linespacefor that? I would imagine we just need some way to tell MacVim to respect the font's native line height. It could either be set as part ofguifont, a new Vim settings, or just a preference set in the GUI preference panel.amadeus commentedon Oct 30, 2019
Fair enough - I always assumed linespace was to create a gap between lines, not actually change the line height.
gruvin commentedon May 3, 2020
@ychin wrote
I will never understand this line of thinking. It's an editor that has always been broken. Fix it. It's not a legacy bank transaction system. It's an editor. No one is going to lose anything if their editor suddenly starts behaving more rationally. Just fix it, for goodness sake. Why not?
Please?
gruvin commentedon May 3, 2020
Wish I knew enough to help more practically. Here's some more info that may help.
This bug never used to happen -- like for years, until a couple or three months ago or however long it's been.
Hopefully the following will at least show a way to reliably duplicate the issue on the dev's system.
MacVim's start-up behaviour is different from any other time a font size or family is changed. At start-up, the lines are too short and font is clipped. After making any change to font however, the issues corrects itself. It's so easy to fix / work around (see below) that I just figured the bug would "go away of its own accord." (Wouldn't that be cool? :p) However, it's been months now. So, I guess the bug's presentation is not as prevalent as I have assumed.
Examples ...
screen snippet

Increase font size +1 then immediately -1 (or any change in font, by any manner)
new screen snippet -- not that lines are "correct" (more appropriate) height now.

Plugins were disabled for this data. Confirming evidence; I usually work on a dark background.
iMac 27" macOS 10.15.4 (19E287)
Bug also present and identical on MacBook Pro, fresh install, 10.15.4 (19E287)
s4y commentedon May 3, 2020
@gruvin Does this happen to you in the
stateful-renderbranch?gruvin commentedon May 3, 2020
@s4y I'm not set up to compile the code myself, sorry
gruvin commentedon May 6, 2020
This issue appears to have been fixed in MacVim Version 8.2.539 (163) which came through the automatic updatimathing, for me at around 2020-05-05 10:00 GMT.
Thanks. :-)
Fix issue with font line spacing support and add option for it