After using (and loving) jEdit for a little while, I realised that, in PHP mode, code like the following is highlighted incorrectly:
... // this is a comment ?>
The problem is that PHP always ends parsing at the closing tag ('?>'), even if the line it's on is commented with // or #. However jEdit's highlighting does not reflect this. This issue is covered in a bug report at:
http://sourceforge.net/tracker/?group_id=588&atid=100588&func=detail&aid=958013
However, I thought I'd bring the discussion here, too. I tried putting the following in the php.xml file:
<SEQ DELEGATE="PHP_LINECOMMENT">//</SEQ> <SEQ DELEGATE="PHP_LINECOMMENT">#</SEQ> <RULES SET="PHP_LINECOMMENT" DEFAULT="COMMENT1"> <SEQ TYPE="NULL" DELEGATE="MAIN">?></SEQ> <SEQ TYPE="NULL" DELEGATE="PHP">
</SEQ> </RULES>
What this does is delegate any code following // or # to my special PHP_LINECOMMENT rule set. This rule set should then end at either a PHP closing tag, going back to HTML mode; or at an end-of-line, going back to normal PHP mode. The former works and the latter doesn't.
This is the main point I wanted to raise for discussion. Why doesn't the newline character (
 or 
) work, and is there a possible workaround? Using the newline character is also applicable to other highlighting issues, including (X/HT)ML attributes, because they can be spread over multiple lines.