Recent

Author Topic: Possible color selection bug  (Read 680 times)

440bx

  • Hero Member
  • *****
  • Posts: 4727
Possible color selection bug
« on: November 02, 2024, 08:54:45 am »
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.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

paweld

  • Hero Member
  • *****
  • Posts: 1268
Re: Possible color selection bug
« Reply #1 on: November 02, 2024, 09:04:34 am »
All IDE directives {%*} are recognized as comments.

Only compiler directives {$*} are identified as “directive”.
Best regards / Pozdrawiam
paweld

440bx

  • Hero Member
  • *****
  • Posts: 4727
Re: Possible color selection bug
« Reply #2 on: November 02, 2024, 09:31:20 am »
All 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.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

paweld

  • Hero Member
  • *****
  • Posts: 1268
Re: Possible color selection bug
« Reply #3 on: November 02, 2024, 09:58:48 am »
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.
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
Best regards / Pozdrawiam
paweld

n7800

  • Full Member
  • ***
  • Posts: 171
Re: Possible color selection bug
« Reply #4 on: November 02, 2024, 01:27:09 pm »
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.
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

  • Administrator
  • Hero Member
  • *
  • Posts: 10542
  • Debugger - SynEdit - and more
    • wiki
Re: Possible color selection bug
« Reply #5 on: November 02, 2024, 01:42:11 pm »
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

  • Hero Member
  • *****
  • Posts: 1268
Re: Possible color selection bug
« Reply #6 on: November 02, 2024, 02:16:56 pm »
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'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
Best regards / Pozdrawiam
paweld

440bx

  • Hero Member
  • *****
  • Posts: 4727
Re: Possible color selection bug
« Reply #7 on: November 02, 2024, 09:50:33 pm »
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 ;)
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018