i-tu / Hasklig

Hasklig - a code font with monospaced ligatures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Readme is outdated - MacVim now as optional support for ligatures.

HealsCodes opened this issue · comments

I think the title says it all - I worked on a PR which recently got merged into mainline MacVim which enables ligature support for the CoreText renderer 😸

That's great! Can you provide some more information, like a link to the PR? Which release includes or is scheduled to include this feature?

Sure,
The implementation is in PR #56 closing issue #36.
It was merged on August 23rd and is part of MacVim Snapshot 79 released on October 31st.

Here are some visuals:
ligature-demo
demo

Thank you a LOT for doing this, great work! :)

This doesn't seem to work with the recent versions of MacVim; was this highly-anticipated feature disabled for a reason not explicitly made clear in the release branch notes of more recent releases of MacVim?

No, the latest snapshot builds still have it.
But by community decision it was further improved.

The GUI option was converted to a vimrc option.
You can now do set macligatures to toggle them on the fly.

Ah, thanks for taking the time to clear this up!

On Fri, Dec 4, 2015 at 11:49 AM, Shirk notifications@github.com wrote:

No, the latest snapshot builds still have it.
But by community decision it was further improved.

The GUI option was converted to a vimrc option.
You can now do set macligatures to toggle them on the fly.


Reply to this email directly or view it on GitHub
#32 (comment).

Kevin Lozandier
lozandier@gmail.com lozandier@gmail.com

screen shot 2016-01-13 at 10 01 20 pm

I have the right MacVim version, the right font, and ligatures enabled, but still... It actually worked randomly using Fira Code, say, 3% of the time :/

Any idea?

Hmm..
While I haven't tried with Haskellig yet I'm using Fira Code along with the Core Text renderer and set macligatures.
I see you have cursorline enabled (finally I'm not alone!) - could you maybe try set number and set relativenumber in addition?

It shouldn't make a difference since the ligatures option now forces redraws of it's own but might be worth a try..

Mmm, doesn't make any difference. What is Core Text renderer, BTW?

If you look at the animated GIF in my second comment you can see the option.
It's located in the Gui settings dialogue.

@joaomilho - I think I found your problem (and I have to say it's likely a limitation of what we currently can do in the renderer in MacVim).

MacVim requires all characters forming a ligature to be rendered in one go (e.g <+> have to be detected in sequence). However the Vim core which is issuing the drawing commands to all GUI frontends is implemented in a way that it will issue multiple drawing calls for differently colored characters.
(There also is currently an open issue with ligatures if you use colorcolumn for the same reason).

You can check by disabling syntax highlighting:
ligatures-syntax-impact

It's best visible in line 5 where all of the <X> triples switch between normal and ligature rendering.

I actually experience no difference by setting :syntax off.

Did you check the GUI settings for the CoreText renderer?
coretext renderer

I'm currently testing on an in-between-88-and-89 version and it works fine for me.

Yeap, both with and without.

Actually closing after changing the config makes it work, sometimes. With the syntax off works consistently, but with syntax on in some places, and it adds a red background in the ones that fail. Kinda like...
screen shot 2016-01-14 at 10 50 10 pm
screen shot 2016-01-14 at 10 49 58 pm

I suppose this will depend on the filetype... (2 mins later) ... yeah, of course, in a .hs file it works correctly since my highlight considers <$> a sequence, while in, say, html it considers $ a tag name and changes the color.

BTW, what about function => ƒ ? :D

There, now I'm really eager to find your problem..
However I'm almost headed for bed - mind sharing your vimrc in a gist or something so I can have a deeper look tomorrow after work?
(would also be nice to know the plugins you're using)

I guess you didn't read my last comment, it's actually working fine now :D Thanks a lot.

Ah, yes I didn't read that while posting my comment.. Glad it works now 👍

Greetings,
I'm also facing same problem. Ligatures doesn't effect immediately. I only see them after i go to next line. I do have same settings as above.

If i uncheck both "Use Core text renderer" & "Draw marked text inline", it works like a charm.

BTW, i'm using version 8.0.3

commented

Amazing patch, but yea it’s all funky for me until you hit Enter or rerender it

firagif

Turning off CoreText Renderer just makes everything look terrible

Anything? I really love this feature.