AutoIT - highlighting non-comment as a comment

Did you find any problems using this software? Please post here...
Post Reply
sl23
Posts: 167
Joined: 29.01.2013 10:04

AutoIT - highlighting non-comment as a comment

Post 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.
Live for an ideal and leave no place in the mind for anything else.
main Alexey
Posts: 2591
Joined: 25.08.2021 18:15

Re: AutoIT - highlighting non-comment as a comment

Post 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?
main Alexey
Posts: 2591
Joined: 25.08.2021 18:15

Re: AutoIT - highlighting non-comment as a comment

Post 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.
main Alexey
Posts: 2591
Joined: 25.08.2021 18:15

Re: AutoIT - highlighting non-comment as a comment

Post 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.
Post Reply