Recent

Author Topic: SynEdit and Synfacil is poosible to implement hihgliter  (Read 771 times)

eldonfsr

  • Hero Member
  • *****
  • Posts: 526
SynEdit and Synfacil is poosible to implement hihgliter
« on: October 22, 2024, 09:49:35 pm »
Just question a friend ask me if possible to implement and Highlighter or syntax for this kind of codes

MD67,RL26,IC31,MG"FAIL, PIN_20 OPEN.",MC243
MD68,RA51,IU0,MJ191
MD69,MG,MG"   ***CABLE PASSES CONTINUITY TEST***",MG,MJ70
MD70,MG,MG"TESTING FOR THE CABLE SHORT CIRCUIT."
MD71,MG,MG"UNPLUG THE BLACK CONNECTOR ON THE BOARD."
MD72,VI"READY, PRESS 1 ONLY ":70,MG" WAITING..."
MD73,RA70,IE1,MJ74,NO0,MJ72
MD74,AL0,AR71

i not expert on synedit is like macro code but is not...


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki

eldonfsr

  • Hero Member
  • *****
  • Posts: 526
Re: SynEdit and Synfacil is poosible to implement hihgliter
« Reply #2 on: October 23, 2024, 02:27:30 pm »
highlighter or syntax check  mainly highlither...


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: SynEdit and Synfacil is poosible to implement hihgliter
« Reply #3 on: October 23, 2024, 02:58:20 pm »
And what should it highlight?
- Every word?
- "..." ?
- ,
- *** ?

SynPositionHighlighter allows you to set your own begin and end of each word.

SynAnySyn allows you to add a list of words (no patterns, just words)

TextMate allows patterns and reg-ex (google textmate, the file format for it is documented on the net)

Or implement/code your own. See 1st link for tutorial.

eldonfsr

  • Hero Member
  • *****
  • Posts: 526
Re: SynEdit and Synfacil is poosible to implement hihgliter
« Reply #4 on: October 24, 2024, 06:38:41 pm »
Martin SynPositionHighlighter this of synedit or pluging this could be best option  i think to unse TSynanysyn but i don't see property Synposition

can you tell  me lite more about this please...   sorry but i new on synedit

thanks

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: SynEdit and Synfacil is poosible to implement hihgliter
« Reply #5 on: October 24, 2024, 07:03:57 pm »
if you add TSynPositionHighlighter to your form, then you can navigate (Alt-Up) to its source and look at it.

unit SynHighlighterPosition

and you will find

Code: Pascal  [Select][+][-]
  1.     procedure AddToken(Line, // 0 based
  2.                        Col: integer; // 1 based
  3.                        TokenKind: TtkTokenKind);
  4.     function CreateTokenID(const aName: string; Foreground, BackGround: TColor;
  5.                            Style: TFontStyles): TtkTokenKind;
  6.  

I haven't tested it.

But probably: create an id (for the color you want), and then insert the token pos.

You can clear them by line: ClearTokens(line)
And then add them elsewhere.

All else... I don't know. I would have to read through the source myself. Just as you would have to.

 

TinyPortal © 2005-2018