Property files and comments

25 views
Skip to first unread message

BugFix@AutoIt

unread,
Jan 3, 2022, 6:43:25 AM1/3/22
to scite-interest
Until now, I had assumed that comments in property files were on a separate line, preceded by #. Now I found in the "SciTEGlobal.properties" (SciTE4AutoIt) the following entry:
fold.comment=1 #fold.comment=2 #folding inside commentblocks - Only available in SciTE4AutoIt3 version
When I read this key ( print(props['fold.comment']) ), I get the value "1". So the rest in the line is treated as comment.
However, if I copy this line into the "SciTEUser.properties" and now read out the key, I also get the comment as belonging to the value: "1 #fold.comment=2 #folding inside commentblocks - Only available in SciTE4AutoIt3 version".
This confuses me. Are comments treated differently in the property files or how can this behavior be explained?

Best Regards
BugFix

Neil Hodgson

unread,
Jan 3, 2022, 10:09:59 PM1/3/22
to scite-interest
BugFix@AutoIt:

> Until now, I had assumed that comments in property files were on a separate line, preceded by #.

That is correct. The code scans through whitespace (space or tab) and if the first non-whitespace character is ‘#’ then the line is ignored.

> Now I found in the "SciTEGlobal.properties" (SciTE4AutoIt) the following entry:
> fold.comment=1 #fold.comment=2 #folding inside commentblocks - Only available in SciTE4AutoIt3 version
> When I read this key ( print(props['fold.comment']) ), I get the value "1". So the rest in the line is treated as comment.

Maybe that is a SciTE4AutoIt extension. The reason that ‘#’ is not treated as a comment start elsewhere on a line by SciTE is that that would make using ‘#’ in settings (like colours) more difficult.

For example this setting would be truncated:
style.python.0=fore:#808080

Neil

Jos

unread,
Jan 4, 2022, 7:50:37 AM1/4/22
to scite-interest
That line in SciTEGlobal.properties is a mistake in the SciTE4AutoIt3 distribution version and should be on 2 lines. It will be changed in the next version.

Jos

Op dinsdag 4 januari 2022 om 04:09:59 UTC+1 schreef Neil Hodgson:

BugFix@AutoIt

unread,
Jan 5, 2022, 8:25:32 AM1/5/22
to scite-interest
Thank you for your answers. And before I forget: Happy New Year to everyone here.
Reply all
Reply to author
Forward
0 new messages