Recent

Author Topic: Highlighters works in half  (Read 2550 times)

Borneq

  • Full Member
  • ***
  • Posts: 248
Highlighters works in half
« on: December 08, 2019, 10:16:38 am »
I have add all highlighters from Synedit tab and Synedit extrac tab.
After it, not highlight text, thus is outline (in png attachment)
---
The same, if I write in code
Code: Pascal  [Select][+][-]
  1. SynPas:=TSynPasSyn.Create(self);
instead of SynPasSyn1 on form.

I do:
Code: Pascal  [Select][+][-]
  1. procedure TCommandsDataModule.LoadHL;
  2. var
  3.    SynPas: TSynCustomHighlighter;
  4. begin
  5.    SynPas:=TSynPasSyn.Create(self);
  6.    SynPas.CommentAttribute.Foreground := clTeal;
  7.    SynPas.IdentifierAttribute.Foreground := clNavy;
  8.    SynPas.KeywordAttribute.Style:=[fsBold];
  9.    SynPas.StringAttribute.Foreground := clFuchsia;
  10.    SynPas.WhitespaceAttribute.Background := clNone;
  11. end;
  12.  
1. When I try set SymbolAttribute was error
2.There are also other attributes not listed and differs for each highlighter
« Last Edit: December 08, 2019, 02:45:07 pm by Borneq »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Highlighters works in half
« Reply #1 on: December 08, 2019, 02:40:24 pm »
I can see Keywords in bold, so it is highlighted.

You may have to set some colors yourself. Look for properties called "....Attri[bute]"

E.g
Code: Pascal  [Select][+][-]
  1. PasHl.SymbolAttri.Foreground := clRed;


Some features you see in the IDE, like the "vertical outline from begin to end" are provided by "Markup" modules:
unit SynEditMarkupFoldColoring
  MarkupFoldColors := TSynEditMarkupFoldColors.Create(Synedit);
  TSynEditMarkupManager(Synedit.MarkupMgr).AddMarkUp(MarkupFoldColors);


« Last Edit: December 08, 2019, 02:45:04 pm by Martin_fr »

Borneq

  • Full Member
  • ***
  • Posts: 248
Re: Highlighters works in half
« Reply #2 on: December 08, 2019, 03:16:49 pm »
I do:
Code: Pascal  [Select][+][-]
  1. procedure TCommandsDataModule.LoadHL;
  2.   procedure setDefAttr(SynHL: TSynCustomHighlighter);
  3.   begin
  4.     SynHL.CommentAttribute.Foreground := clTeal;
  5.     SynHL.IdentifierAttribute.Foreground := clNavy;
  6.     SynHL.KeywordAttribute.Style:=[fsBold];
  7.     SynHL.StringAttribute.Foreground := clFuchsia;
  8.     SynHL.WhitespaceAttribute.Background := clCream;
  9.   end;
  10. var
  11.    SynHL: TSynCustomHighlighter;
  12. begin
  13.    SynHL:=TSynPasSyn.Create(self);
  14.    setDefAttr(SynHL);
  15.    SynHL:=TSynCppSyn.Create(self);
  16.    setDefAttr(SynHL);
  17.    SynHL:=TSynSqlSyn.Create(self);
  18.    setDefAttr(SynHL);
  19.    //etc...
  20. end;
  21.  
(I have problem z metaclasses and creation highter from typo from array)
But for c++ is also preprocessor attribs, not exists in TSynCustomHighlighter how do its?

===
How remove outline horizontal lines?
« Last Edit: December 08, 2019, 04:29:19 pm by Borneq »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Highlighters works in half
« Reply #3 on: December 08, 2019, 05:33:03 pm »
You can set the attributes in the object inspector....

for the horizontal divider lines (IIRC)
Code: Pascal  [Select][+][-]
  1.     property DividerDrawConfig[Index: Integer]: TSynDividerDrawConfig
  2.       read GetDividerDrawConfig;
  3.     property DividerDrawConfigCount: Integer read GetDividerDrawConfigCount;
  4.  

All entries have TopColor and NestColor => set them to clNone

 

TinyPortal © 2005-2018