Recent

Author Topic: Creating a Syntax Highlighter  (Read 6562 times)

captian jaster

  • Guest
Creating a Syntax Highlighter
« on: October 30, 2010, 08:05:03 pm »
How do I create a syntax highlighter for the SynEdit?  :-[

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9915
  • Debugger - SynEdit - and more
    • wiki
Re: Creating a Syntax Highlighter
« Reply #1 on: October 30, 2010, 08:59:27 pm »
There are various previous threads on the forum:
http://www.lazarus.freepascal.org/index.php/topic,10260.0.html
http://www.lazarus.freepascal.org/index.php/topic,7879.0.html
http://www.lazarus.freepascal.org/index.php/topic,7338.0.html

Unfortunately there is no tutorial, not even much documentation.

It depends on the exact feature your highlighter should have....

There are simpler highlighters that can be used to study the workings.
- LFM or Diff, both with folding
- SynAny / SynPosition (see examples in Laz)

There is a little bit of  info on the wiki:
http://wiki.lazarus.freepascal.org/SynEdit_Highlighter#References

Includes the following info:
"If Highlight attributes are required SynEdit will request them per Line too. SynEdit will loop through individual tokens on a line. This currently happens from nested proc PaintLines in SynEdit.PaintTextLines. ....."

That is where you see how it is called. How it must return Result

In SynEdit is also a doc folder with tiny bits of info (on highlighters).
It does explain some of the names used, so read it, before trying to look at any of the existing highlighters.

-----
You will have to discover some on your own.

Because if I had the time to give a complete answer, I would already have written a tutorial.

If you have specific questions, then ask


 

TinyPortal © 2005-2018