Fanael / rainbow-delimiters

Emacs rainbow delimiters mode
GNU General Public License v3.0
685 stars 33 forks source link

Mismatched face for closing tags of jsx syntax in emacs 27.0.50 #41

Closed mallt closed 5 years ago

mallt commented 5 years ago

The closing tags of the new jsx syntax support in emacs 27.0.50 are shown in the rainbow-delimiters-mismatched-face:

afbeelding

This is the cursor position info:

             position: 55 of 106 (51%), column: 15
            character: > (displayed as >) (codepoint 62, #o76, #x3e)
              charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x3E
               script: latin
               syntax: )    which means: close
             category: .:Base, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET 3e" or "C-x 8 RET GREATER-THAN SIGN"
          buffer code: #x3E
            file code: #x3E (encoded by coding system undecided-unix)
              display: by this font (glyph code)
    xft:-SRC-Hack-normal-normal-normal-*-24-*-*-*-m-0-iso10646-1 (#x2F2)

Character code properties: customize what to show
  name: GREATER-THAN SIGN
  general-category: Sm (Symbol, Math)
  decomposition: (62) ('>')

There are text properties here:
  face                 (rainbow-delimiters-mismatched-face)
  font-lock-multiline  t
  fontified            t
  js-jsx-syntax-table  (5)
  syntax-multiline     t
  syntax-table         (5)

Does anyone know how to fix this? Thanks!

Fanael commented 5 years ago

This looks like a problem with jsx syntax support, does the syntax-table property on the opening angle bracket correctly specify the matching closing bracket? Because the one on the closing bracket doesn't, the matching character is specified as nil here.

mallt commented 5 years ago

This is the cursor position info of the opening angle bracket:

             position: 52 of 106 (48%), column: 11
            character: < (displayed as <) (codepoint 60, #o74, #x3c)
              charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x3C
               script: latin
               syntax: (    which means: open
             category: .:Base, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET 3c" or "C-x 8 RET LESS-THAN SIGN"
          buffer code: #x3C
            file code: #x3C (encoded by coding system undecided-unix)
              display: by this font (glyph code)
    xft:-SRC-Hack-normal-normal-normal-*-24-*-*-*-m-0-iso10646-1 (#x2F9)

Character code properties: customize what to show
  name: LESS-THAN SIGN
  general-category: Sm (Symbol, Math)
  decomposition: (60) ('<')

There are text properties here:
  face                 (rainbow-delimiters-depth-2-face)
  font-lock-multiline  t
  fontified            t
  js-jsx-close-tag-pos 97
  js-jsx-syntax-table  (4)
  js-jsx-tag-beg       (open . 57)
  syntax-multiline     t
  syntax-table         (4)

So indeed it seems no matching char is specified. I will report this in the emacs bug tracker.

Thanks a lot!