coteditor / CotEditor

Lightweight Plain-Text Editor for macOS
https://coteditor.com
Other
6.37k stars 432 forks source link

Error in syntax highlighting for Syntax Style "ShellScript" #1483

Open rovf opened 1 year ago

rovf commented 1 year ago

Description

$# is not highlighted as special variable

To Reproduce

Create a POSIX shell script which contains the following statement:

(( $# > 0 )) && [[ ${@: -1:1} == 1 ]] && echo true

Expected behavior

The three statements are highlighted as statements. However, the highlighter treats the # in $# > 0 as the start of a comment and highlights the whole line as comment.

CotEditor version

4.5.4 (566)

macOS version

12.6.5 (Build 21G531)

Additional context

No response

clayton256 commented 1 year ago

Something similar is happening with CSS & Javascript code highlighting within a php file. When the CSS code contains a color code such as #f5f5f5, the pound and everything following is highlighted as a comment. Similarly, when the JS code has a DOM reference such as #successmsg, everything after the pound is highlighted as a comment.