Possible color selection bug lazarus / 9-Editor ---------------------------------------------------------------------- 440bx · 2024-11-02 07:54 Hello, observed in Lazarus v3.99, 2024-10-23 In IDE Options/Editor, when clicking on the "{%region /fold}" line to select the IDE Directive, what is selected is "Comment" instead. It is necessary to select IDE directive on the left hand side in order to set the color(s) for it.  This is unlike the other items which can be selected by clicking on their corresponding line in the right hand side. The attachment shows "Comment" selected after clicking on the "{%region /fold}" line. Comments welcome. ---------------------------------------------------------------------- paweld · 2024-11-02 08:04 All IDE directives {%*} are recognized as comments. Only compiler directives {$*} are identified as “directive”. ---------------------------------------------------------------------- 440bx · 2024-11-02 08:31 Quote from: paweld on November 02, 2024, 09:04:34 amAll IDE directives {%*} are recognized as comments. They are comments but, the IDE recognizes and differentiates between plain comments, compiler directives and IDE directives (which are all technically comments.) Click on "IDE Directives" on the left hand side and it will select the "{%region /fold}" line on the right hand side.  This means that clicking on "{%region /fold}" on the right hand side should select "IDE Direcitives" _not_ select "Comment", just as clicking on "{$R- compiler directive} does _not_ select "Comment", it selects "Directive" as it should. ---------------------------------------------------------------------- paweld · 2024-11-02 08:58 Quote from: 440bx on November 02, 2024, 09:31:20 amClick on "IDE Directives" on the left hand side and it will select the "{%region /fold}" line on the right hand side.  This means that clicking on "{%region /fold}" on the right hand side should select "IDE Direcitives" _not_ select "Comment", just as clicking on "{$R- compiler directive} does _not_ select "Comment", it selects "Directive" as it should. I understand that. I just wanted to write that since I remember “IDE directives” are treated as comments. So I don't consider it a bug ---------------------------------------------------------------------- n7800 · 2024-11-02 12:27 Quote from: paweld on November 02, 2024, 09:58:48 amQuote from: 440bx on November 02, 2024, 09:31:20 amClick on "IDE Directives" on the left hand side and it will select the "{%region /fold}" line on the right hand side.  This means that clicking on "{%region /fold}" on the right hand side should select "IDE Direcitives" _not_ select "Comment", just as clicking on "{$R- compiler directive} does _not_ select "Comment", it selects "Directive" as it should. I understand that. I just wanted to write that since I remember “IDE directives” are treated as comments. So I don't consider it a bug The IDE allows you to specify a separate color for IDE directives, so it makes sense that when you click on it, the color of the IDE directive should be highlighted, not just the comment. I think it is worth creating a report on the bug tracker. ---------------------------------------------------------------------- Martin_fr · 2024-11-02 12:42 It could probably (not sure) be improved (you can report it as a bug). The problem here is that "IDE directive" is not a "base color" but on overlay. (you can see that it has alpha channels). So if you set it to "off" for all/any of its colors, then it will show as comment. If you use Alpha then it mixes to the comment color. I don't recall how those clicks are detected. There are some overlays that work on click. But  I don't know if that can easily be extended. The same issue exists for - case labels - proc headers - proc modifiers like virtual (not present in sample text) - pas doc (not present in sample text) - current line gutter color .... ---------------------------------------------------------------------- paweld · 2024-11-02 13:16 Quote from: n7800 on November 02, 2024, 01:27:09 pmThe IDE allows you to specify a separate color for IDE directives, so it makes sense that when you click on it, the color of the IDE directive should be highlighted, not just the comment. I've looked through this list so many times and only when you wrote did I notice this item. @440bx: I admit you are right, it looks like a bug ---------------------------------------------------------------------- 440bx · 2024-11-02 20:50 Issue created, Link: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41222 issue: 41222 @paweld, no sweat, every now and then I manage to be right ---------------------------------------------------------------------- flowCRANE · 2025-06-01 12:28 I reported a new issue because not only is there a bug related to selecting an IDE directive in the IDE settings window, but also SynEdit code editors colorize such directives like comments. Currently, the ability to select a separate style for IDE directives makes no sense, since this style is ignored and not used by SynEdit anyway. So this absolutely needs to be fixed. [#41683] SynEdit — IDE directives are colored as comments, not as directives ---------------------------------------------------------------------- paweld · 2025-06-01 13:08 @flowCRANE: set a higher priority for IDE Directive than for Comments.