-
-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ligature Support #81
Comments
I was able actually to get ligatures working in the CM6 demo! Added the following: <link rel="stylesheet" href="https://unpkg.com/[email protected]/distr/fira_code.css">
<style>
.codemirror { height: 300px; overflow: auto; border: 1px solid silver; font-family: 'Fira Code';}
</style> Everything seems to work fine with ligatures (cursor placement, navigation). Maybe this issue can be closed already, if there are no new special cases to handle. I wonder if it's possible to enable only certain ligatures. Not sure... Probably out of CodeMirror scope. |
What happens when you put the cursor in the middle of such a ligature? Last time I tried, several browsers did very wrong things there (like showing the cursor as if it is before the entire ligature). We'll have to do a survey of browser behavior to see how realistic this is. |
@marijnh Fira Code and Pragmata Pro work super awesome in browsers (and mobile too). |
In Chrome and Firefox the cursor and selections in the middle of 1, 2, and 3 character ligatures behave exactly as if you were dealing with the original characters. |
Maybe we could turn off ligatures selectively, based on the browser? Is anyone able to test this in Safari? |
I've had good experience setting font-variant-ligatures dynamically, allowing users to flip a switch to enable or disable ligatures. No reason this could not be set based on browser detection. It almost feels like something that could/should live in "user space", outside CodeMirror. Not sure. |
Modern browsers seem to handle ligatures pretty well, and for ones that conceptually contain multiple characters, they provide working cursor positions between the characters. Feel free to open an issue if something specific is broken, but I don't think this needs to say open. |
This may be too much of an ask, but I thought I'd propose that CM6 support ligatures.
For example, I'd be interested in using FiraCode with certain ligatures enabled such as fat arrow.
Related:
The text was updated successfully, but these errors were encountered: