Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TCL] Comments directly after opening curly brace are not correctly rendered #2200

Open
mholzmayr opened this issue Nov 13, 2019 · 1 comment
Labels
C: Syntax T: bug A bug in an existing language feature

Comments

@mholzmayr
Copy link

  • Sublime Version: 3.2.2
  • OS Version: Windows 10 (latest udpates)
proc test { arg1 } {# this comment-colour is odd
	set a 1
}

image

@Bogdan107
Copy link

I fill bug firstly to forum.sublimetext.com, but duplicate there.

Steps:

  1. Color theme - "jEdit" (jEdit Color Theme).
  2. File "test.tcl".
  3. Syntax: "Tcl".
  4. Code example:
32: proc ::_buttontoggleHandler { cbox args } {
33:   # Foreground of this comment is green.
34:   if {$args eq "invoke"} {  # Foreground of this comment is black.
35:     $cbox invert;           # Foreground of this comment is black too
36:   };
37:   $cbox {*}$args;
38: };
  1. Check, that Sublime highlight the comments does not as expected.

Behaviour of the Sublime-Text:

Correct behaviour must be:

  1. Lines after the first symbol "#", which is not backslashed (backslashed symbols "#" - is not an indicator of start of comment), to the end of the line - must be highlighted as a comment (foreground=green, like in line 33).
    Syntax checker of the Tcl interpreter can detect, which words with "#" symbol is a part of argument, or is a comment, but in simple case (as in most editors, which I used, and which has the Tcl syntax highlight function), the line from the first un-backslashed symbol "#" - highlighted as comment.
    Line 34 shows, that syntax highlight function is bugged.
  2. Lines after the un-backslashed symbol ";" - is a new Tcl command. And all Tcl commands, which first printable symbol is a un-backslashed "#" - is a comment. So, comment at the end of line 35 must be highlighted as a comment (style foreground=greed, like in line 33).
    Line 35 show, that syntax highlight function is bugged.

Behaviour of the Eclipse:

  • line 33 - is highlighted as a normal comment;
  • line 34 - comment at the end of the line is not highlighted (Eclipse can't detect comments at the end of the command);
  • line 35 - comment at the end of the line is highlighted (the symbol ";", which placed before the symbol "#", allows Eclipse to handle next words as a new command, which interpreted as comment, because this command has first printable symbol "#").

Behaviour of the Geany:

Geany editor correctly highlight comments at all lines as a comments: 33, 34 and 35.

@FichteFoll FichteFoll added the T: bug A bug in an existing language feature label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Syntax T: bug A bug in an existing language feature
Projects
None yet
Development

No branches or pull requests

4 participants