Skip to content
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

Font ligatures not working properly with C and C++ syntax highlighting #17306

Closed
vittorioromeo opened this issue Dec 15, 2016 · 4 comments
Closed
Assignees

Comments

@vittorioromeo
Copy link

vittorioromeo commented Dec 15, 2016

  • VSCode Version: 1.7, 1.8, insiders
  • OS Version: Windows 10, Arch Linux x64

Steps to Reproduce:

  1. Set font to "Fira Code" (or any similar font which uses programming ligatures).
  2. Enable ligatures with "editor.fontLigatures": true.
  3. Write code for a lambda with trailing return type or a -> access to a method.
  4. The ligatures are not expanded correctly (see screenshot below).

incorrect ligatures with C++ syntax highlighting


Setting the syntax to "Plain Text" makes the ligatures work correctly.

correct ligatures with Plain Text syntax highlighting


(This also applies to other ligatures, not only ->.)

(This also applies to C syntax highlighting.)

@siegebell
Copy link

This is a partial duplicate of #2870 - the C++ grammar is parsing - and > into separate tokens. If you are using a built-in grammar for C++, you should make a feature request to have -> and other operators parsed as one token.

Or you can use prettify-symbols-mode - see this thread for a discussion on how to make it work for Fira Code.

@siegebell
Copy link

siegebell commented Dec 15, 2016

Actually, I think this is a bug in the built-in C++ grammar. Commit 5598ee0 ensures that identical tokens are merged, but while - is given scope keyword.operator.c, the grammar incorrectly assigns > scope keyword.operator.comparison.c.

@siegebell
Copy link

related: atom/language-c#177

@vittorioromeo vittorioromeo changed the title Font ligatures not working properly with C++ syntax highlighting Font ligatures not working properly with C and C++ syntax highlighting Dec 15, 2016
@aeschli
Copy link
Contributor

aeschli commented Jan 30, 2017

Thanks @siegebell for the analysis.
Closing as dup of atom/language-c#177

@aeschli aeschli closed this as completed Jan 30, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants