Skip to content

Disable font ligatures for lookahead/lookbehind prefixes (regex) #126

@andrebrait

Description

@andrebrait

While this was a recent development in Fira Code, I think it's something they did right and maybe should also be implemented here (all screenshots are from JetBrains Mono 1.0.2).

  • FiraCode in IntelliJ IDEA in a Java file:
    Fira-IDEA-Java

  • JetBrains Mono in IntelliJ IDEA in a Java file:
    JetBrains-IDEA-Java

  • FiraCode in IntelliJ IDEA in a Python file:
    Fira-IDEA-Python

  • JetBrains Mono in IntelliJ IDEA in a Python file:
    JetBrains-IDEA-Python

Sometimes, the ligature used is different depending on the text editor, too:

  • FiraCode in Visual Studio Code in a Plain Text file (identical results in a Shell Script file):
    Fira-VSCode-Text

  • JetBrains Mono in Visual Studio Code in a Plain Text file (identical results in a Shell Script file):
    JetBrains-VSCode-Text

Other times, both end up using ligatures, though different ones, depending on the text editor, too (and maybe this is an issue with IntelliJ?):

  • FiraCode in IntelliJ IDEA in a Shell Script file:
    Fira-IDEA-Shell

  • JetBrains Mono in IntelliJ IDEA in a Shell Script file:
    JetBrains-IDEA-Shell

See tonsky/FiraCode#578 for more details on what Fira Code did in this case.

From their changelog:

Disabled ligatures after regexp lookahead/lookbehinds (?<=< (?<=> (?<==> (?<=| (?<== (?=:= (?=!= (?== (?=== (?==> (?=> (?=>> (?=<< (?=/= (?!! (?!!. (?!= (?!== (?<!! (?<!!. (?<!= (?<!== (?<!--

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions