Page 1 of 1

resolved: new syntax files... ugh!!

Posted: 29 Nov 2023 00:17
by DerellLicht1
Hi @pjj ; Could you help me again, I'm confused...
I want to add syntax highlighting support for AutoIt files (.au3) ...
So went to Environment -> Addons -> Highlighters ...
There is already an option for AutoIt3, so I enabled that... I then added .au3 files to the file-extension list...

I then closed/re-opened RJTE, but I still don't have syntax highlighting for my .au3 file...
I also closed the program, then copied @micha_he's AutoIt syx file from this thread:
viewtopic.php?t=2974
to C:\Users\dan7m\AppData\Roaming\RJ TextEd/Syntax ...

I now have the following AutoIt files in the RJTE files:
06/30/23 13:08:02 C:\Users\dan7m\AppData\Roaming\RJ TextEd/Syntax/AutoIt.ini
03/11/22 12:42:09 C:\Users\dan7m\AppData\Roaming\RJ TextEd/Syntax/AutoIt.syx
01/14/15 09:27:00 C:\Users\dan7m\AppData\Roaming\RJ TextEd/Syntax color themes/SciTE4AutoIt V1.xml

But I *still* don't get AutoIt syntax highlighting ...

What am I missing??

Re: new syntax files... ugh!!

Posted: 29 Nov 2023 07:43
by micha_he
I have no idea, it should actually work out of the box.

Re: new syntax files... ugh!!

Posted: 29 Nov 2023 10:03
by pjj
micha_he wrote: 29 Nov 2023 07:43 I have no idea, it should actually work out of the box.
Seconded :?

Now, I want some questions, now!

Image

Thank you, yes, answers.

Do you use the newest version of our beloved editor? There was a tiny glitch with regard to recognizing highlighters, fixed in 16.01.

Do you have Options > File > Save status for last open files > Save highlighter checked? If so, please uncheck it and find out if it have helped.

Re: new syntax files... ugh!!

Posted: 29 Nov 2023 15:40
by DerellLicht1
Aye, I'm using V16.01...

And actually, this syntax file *is* working... sometimes...

I closed and re-opened the wfas.au3, and it came up using the proper syntax!

I then opened another .au3 and it did *not* use it, but then I closed and re-opened *that* file, and it now is working!!

That gave me the idea that it was just failing on the first open for each .au3 file, but I opened a *third* file, and it's working fine on first try...
So I don't know what is going on, but for now, the AutoIt highlighting seems to be working fine... heh...

@pjj: I *do* have Save highlighter checked... but since it is working now, I'm not sure if I should mess with it??
In any case, what is the significance of that option?? Even if it's turned off, when I re-open the file, the editor will use the appropriate syntax hiliting anyway, won't it??

Re: new syntax files... ugh!!

Posted: 29 Nov 2023 15:52
by DerellLicht1
micha_he wrote: 29 Nov 2023 07:43 I have no idea, it should actually work out of the box.
Hi, micha_he !! I'm surprised to see you still around; your previous thread is almost a decade old...

Anyway, I *do* have a possible, *very* minor, bug in your AutoIt syntax file...
In block comments, #ce is "end of block", but it is *still* a comment line, so the entire line *should* be in the Comment color, but it is not...
The #ce is comment color, but the rest of the line is not... see included image.
Is that something that would be easily modified??
ScreenShot.jpg
ScreenShot.jpg (13.03 KiB) Viewed 3952 times

Re: new syntax files... ugh!!

Posted: 29 Nov 2023 18:10
by pjj
DerellLicht1 wrote: 29 Nov 2023 15:40 @pjj: I *do* have Save highlighter checked... but since it is working now, I'm not sure if I should mess with it??
In any case, what is the significance of that option?? Even if it's turned off, when I re-open the file, the editor will use the appropriate syntax hiliting anyway, won't it??
The idea (as I understand it) is that when this option is set on, you can manually assign to a file a highlighter that is different than the standard (i.e. based on file extension) one, and it will be remembered; e.g. for the file named exception.txt you can assign C++ highlighter and it will be remembered and opened with this new one instead of old and boring "Text file". This new setting has been introduced recently. If you don't have such exceptions in your projects, I guess you don't need this option to be switched on.

Perhaps you have inadvertently assigned to your files the wrong highlighter (i.e. before switching on AutoIt highlighter) and subsequently they were opened with it? And your third file was opened with the correct one, because it was then already switched on, as per your first post?

Re: new syntax files... ugh!!

Posted: 29 Nov 2023 19:39
by DerellLicht1
pjj wrote: 29 Nov 2023 18:10 Perhaps you have inadvertently assigned to your files the wrong highlighter (i.e. before switching on AutoIt highlighter) and subsequently they were opened with it? And your third file was opened with the correct one, because it was then already switched on, as per your first post?
Well, I didn't *explicitly* assign the files to another highlighter, but...
well, no... I was thinking maybe it picked up the highlighter for one of the other files that I had open (the others were C++), but if that had been the case, I would have had *some* kind of highlighting present, since AutoIt and C++ share some characteristics... in my case, they were just coming up as text files...

ummm... maybe they *did* have .txt set as default, since I had that flag set?? just guessing, though...
anyway, I'll turn that flag off just in case - I don't think I've *ever* wanted that...

Re: new syntax files... ugh!!

Posted: 30 Nov 2023 10:09
by micha_he
DerellLicht1 wrote: 29 Nov 2023 15:52 Anyway, I *do* have a possible, *very* minor, bug in your AutoIt syntax file...
In block comments, #ce is "end of block", but it is *still* a comment line, so the entire line *should* be in the Comment color, but it is not...
The #ce is comment color, but the rest of the line is not... see included image.
Is that something that would be easily modified??
Maybe Rickard have an idea, what needs to be changed in the syntaxfile, that this works.

It seems, that this behavior is the same for all block-comments, even in other syntax-files.

Re: resolved: new syntax files... ugh!!

Posted: 09 Dec 2023 14:12
by Rickard Johansson
Fixed in the next release (v16.02). Thanks!

Re: resolved: new syntax files... ugh!!

Posted: 31 Jan 2024 09:39
by micha_he
The change (in V16.02 and newer, tested with actual V16.11) with the AutoIt #ce-line not fully work !
It works only, if #ce is followed by a space.

Otherwise, the entire remaining source code is seen/marked as a comment.

Re: resolved: new syntax files... ugh!!

Posted: 01 Feb 2024 15:27
by Rickard Johansson
Fixed in next release (v16.12). Thanks!