CotEditor icon indicating copy to clipboard operation
CotEditor copied to clipboard

Error in syntax highlighting for Syntax Style "ShellScript"

Open rovf opened this issue 1 year ago • 1 comments

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

rovf avatar May 09 '23 07:05 rovf

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.

clayton256 avatar May 09 '23 19:05 clayton256