Menu

#3638 Java mode syntax highlighting breaks on string escaping

severe bug
closed-fixed
nobody
5
2012-01-13
2012-01-13
Damien
No

When editing a java file, a double-quote string is supposed to highlight up to a non-escaped quote, but currently it treats all backslashes as escaping the quote. For example, in the line

if (lastArg.startsWith("\\")) {

the second backslash is the escaped character, but it's treated as escaping the quote, and everything up to the end of the line is highlighted as a string. This looks weird and breaks bracket matching.

Tested with the current jEdit trunk, revision 20767

Discussion

  • Damien

    Damien - 2012-01-13
    • status: open --> closed-fixed
     
  • Damien

    Damien - 2012-01-13

    I just committed a fix by adding the line

    <SEQ TYPE="LITERAL4">\\&lt;/SEQ>

    to both the double-quote and simple-quote literal rules in front of their respective quote-escaping seqs. It seems to fix the problem.

     

Log in to post a comment.