CotEditor icon indicating copy to clipboard operation
CotEditor copied to clipboard

Shell syntax error for $#

Open timhillgit opened this issue 3 years ago • 0 comments

Description

screenshot

When highlighting the value $# in Shell Script, the editor interprets the # as the start of a comment (see line 1 in screenshot). This both highlights the value incorrectly and "comments out" the rest of the line, which is incorrect. Line 2 of the screenshot has an example of what the highlighting should look like.

To Reproduce

  1. Enter the text (( $# == 0 ))
  2. Switch to "Shell Script" syntax

Expected behavior

$# should be highlighted as a value, not half-value half-comment, and should not comment out the rest of the line.

CotEditor version

4.3.6 (530)

macOS version

12.6 (21G115)

Additional context

The syntax file for shell: https://github.com/coteditor/CotEditor/blob/0c34235a43e252c22eef40bc8fc48959da28738d/CotEditor/Syntaxes/Shell%20Script.yml#L243 appears to be correct so this may be a deeper issue than just a syntax file.

timhillgit avatar Oct 08 '22 18:10 timhillgit