Page 1 of 1

AutoIT - highlighting non-comment as a comment

Posted: 31.07.2025 09:59
by sl23
I'm trying to learn AutoIT and although this is only a minor issue, could you please change lines starting with # as a separate entity to commented lines that start with a ;
Just makes it harder to see where things are. It would be helpful if we could change the colour of these lines beginning with # too.
Here's a screenshot so you can see what I mean:
2025-07-31_11.38.44.jpg
Thank you.

Re: AutoIT - highlighting non-comment as a comment

Posted: 31.07.2025 20:52
by main Alexey
it is easy to change.
Cud allows 2 styles for comments

- Comment
- DocComment (greenish in default theme)

do you suggest to use DocComment for #-lines? or for ;-lines?
SublimeText don't hilite #-lines as comments, it seems. what docs of language tell about #-lines?

Re: AutoIT - highlighting non-comment as a comment

Posted: 31.07.2025 20:57
by main Alexey
okay I got reply from AI:
In AutoIt, the `#` character is used to denote preprocessor directives. Preprocessor directives are instructions that are processed before the actual compilation of the script begins. These directives can be used to include files, define constants, and set various script behaviors.

Here are some common preprocessor directives in AutoIt:

- `#include`: Used to include the contents of another file in the script.
```autoit
#include <File.au3>
```

- `#cs` and `#ce`: Used to define a block of comments.
```autoit
#cs
This is a block comment.
It can span multiple lines.
#ce
```

- `#comments-start` and `#comments-end`: Similar to `#cs` and `#ce`, used to define a block of comments.
```autoit
#comments-start
This is another block comment.
It can also span multiple lines.
#comments-end
```

- `#AutoIt3Wrapper_`: Used for various script compilation options.
```autoit
#AutoIt3Wrapper_Outfile=MyScript.exe
```

- `#Region` and `#EndRegion`: Used to define collapsible regions in the script, which can be useful for organizing code.
```autoit
#Region MyRegion
; Code here
#EndRegion MyRegion
```

- `#OnAutoItStartRegister`: Used to register a function that will be called when the script starts.
```autoit
#OnAutoItStartRegister "MyStartupFunction"
```

These directives help in organizing and controlling the behavior of AutoIt scripts before they are executed.
===========cut end
I will follow this! good suggestion.

Re: AutoIT - highlighting non-comment as a comment

Posted: 31.07.2025 21:51
by main Alexey
reworked the lexer. now #-preprocessor words are highligted as 'Comment2' style.
also changed hilite of #cs....#ce blocks to use one style for the whole comment (to be like SublimeText).
please update from Plugins/AddonsManager and test.

Re: AutoIT - highlighting non-comment as a comment

Posted: 01.08.2025 13:16
by sl23
Sorry, only just seen your message, but it seems you resolved it. Thanks for changing it. ;)

Re: AutoIT - highlighting non-comment as a comment

Posted: 01.08.2025 17:37
by main Alexey
you are welcome, with any lexer-related issues.