* * *

Author Topic: SOLVED: I can not find editor cursor color  (Read 1411 times)

xaver13

  • Jr. Member
  • **
  • Posts: 85
SOLVED: I can not find editor cursor color
« on: October 29, 2017, 04:19:36 pm »
Hello, I tried to use UserSuppliedSchemeSettings, I have a small trouble.
On dark schemes I like, I often have black cursor, and it is difficult to see.
Please where can I change only cursor color to some lighter color? I can not find this option. Thank you very much for help.
« Last Edit: October 29, 2017, 08:16:00 pm by xaver13 »
--
Jiri Cvrk

xaver13

  • Jr. Member
  • **
  • Posts: 85
Re: I can not find editor cursor color
« Reply #1 on: October 29, 2017, 05:47:04 pm »
I found this 6years old post, and there is no solution..   
http://forum.lazarus.freepascal.org/index.php?topic=14105.0
>:(
« Last Edit: October 29, 2017, 05:49:33 pm by xaver13 »
--
Jiri Cvrk

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4553
    • wiki
Re: I can not find editor cursor color
« Reply #2 on: October 29, 2017, 05:53:58 pm »
The caret color is not configurable.

The caret uses xor to invert the current color. That should be fine on black.
However it is a problem on medium grey, as #7f7f7f changes to #808080.

On some OS the OS is providing the caret, and that may not offer any color config.

At the moment SynEdit is bypassing this system caret, and therefore the color can be changed (in code only).
But this may change in future. There are issues bypassing the system caret. So the default may change. But likely an option will then be added.

To change the color in the source code
components\synedit\synpluginmulticaret.pp
line 1721
Code: Pascal  [Select]
  1. constructor TSynPluginMultiCaretBase.Create(AOwner: TComponent);
  2. begin
  3.   inherited Create(AOwner);
  4.   FColor := clBlack;
  5.  

Note that this does not make the caret black.

It will invert all bit on the canvas, that are zero in FColor.

FColor := clWhite;  // the caret will not change any pixel at all
FColor := clRed; // the caret will invert the green and blue channel of each pixel, and leave red as it is.


-------------
For reference: The caret is painted by TSynEditScreenCaretPainterInternal in components\synedit\syneditpointclasses.pas

xaver13

  • Jr. Member
  • **
  • Posts: 85
Re: I can not find editor cursor color
« Reply #3 on: October 29, 2017, 06:10:42 pm »
Thank you very much for tip! I tried it (edit and compile IDE) on  my Mac, I am using High Sierra, but nothing happened. But I must say, that I am very unexperienced user   O:-)

Edited:
Now I checked what happened, and Lazarus.app remains the same. I have some linux executable there, but, no new Lazarus.app.  Please how to force to make application package when I use "Build Lazarus IDE"?
« Last Edit: October 29, 2017, 06:30:04 pm by xaver13 »
--
Jiri Cvrk

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4553
    • wiki
Re: I can not find editor cursor color
« Reply #4 on: October 29, 2017, 06:31:49 pm »
Odd, anyway just tested.

Go to
components\synedit\syneditpointclasses.pas
line 2891
Code: Pascal  [Select]
  1. procedure TSynEditScreenCaretPainterInternal.Init;
  2. ...
  3.   FColor := clBlack;
  4.  

I thought it will be overwritten by the other setting, but it seems not.

If in future the multicaret setting take effect, FColor is used in line 2776
  ACanvas.Pen.Color := FColor;

So you should also be able to force it there.

xaver13

  • Jr. Member
  • **
  • Posts: 85
Re: I can not find editor cursor color
« Reply #5 on: October 29, 2017, 08:15:47 pm »
I used latest fpcupdeluxe-i386-darwin with trunk/trunk option. And cursor is o.k.! No changes was needed.

 ;D

--
Jiri Cvrk

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4553
    • wiki
Re: SOLVED: I can not find editor cursor color
« Reply #6 on: October 29, 2017, 09:08:27 pm »
Which version did have the problem?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1904
Re: SOLVED: I can not find editor cursor color
« Reply #7 on: October 30, 2017, 12:53:33 am »
I believe the "fix" is related to this thread

been bugging me for a long time as well. but it's here in 2017, it's finally fixed :)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus