Sublime Forum

Fira Code ligature for /** breaks with C-syntax

#1

Hello,
When using the Fira Code font in plain-text, the sequence /** is rendered as three distinct characters, as it should be; when using C syntax, /* is replaced with a ligature followed by *. How do I modify the C syntax to not replace the first two characters in the sequence /**?

Thanks!

0 Likes

#2

I have not tested it but what I would try is to modify the comments part so that /** and **/ are scoped as punctuation.definition.comment.c (line 41):

  comments:
    // Patch_begin 
    - match: /\*\*
      scope: punctuation.definition.comment.c
      push:
        - meta_scope: comment.block.c
        - match: \*\*/
          scope: punctuation.definition.comment.c
          pop: true
   // Patch End
    - match: ^/\* =(\s*.*?)\s*= \*/$\n?
      scope: comment.block.c
      captures:
        1: meta.toc-list.banner.block.c
    - match: /\*
      scope: punctuation.definition.comment.c
      push:
        - meta_scope: comment.block.c
        - match: \*/
          scope: punctuation.definition.comment.c
          pop: true
...
0 Likes

#3

This would scope the following incorrectly: /** */. Instead, just modify the existing rule:

    - match: /\*\*?
      scope: punctuation.definition.comment.c
      push:
        - meta_scope: comment.block.c
        - match: \*?\*/
          scope: punctuation.definition.comment.c
          pop: true
0 Likes