Jump to content
Sign in to follow this  

TSynEdit - Custom Highlighter

Recommended Posts



I'm using D11


I need to create a custom highlighter with the following properties:
* VariableList
* FunctionList: must have ()  (open and close parenthesis)

* Literals
* constants



SomeString, SomeInteger, SomeDouble should be highlighted as variable if they are in VariableList

DateFormat( param1, param2 ), Date() should be highlighted as functions only when the '(' is typed;


The following expression should be display like:


c:\temp\DateFormat( Date, "yyyy_mm_dd")    // here Date is a variable


I found some old code in the internet for older versions/branches of TSynEdit. I'm using the latest from Getit!
Is there any example somewhere?




Share this post

Link to post

- Update your SynEdit to the latest version from TurboPack/SynEdit: SynEdit is a syntax highlighting edit control, not based on the Windows common controls. (github.com)

-  Look at the SynGen folder.  The file Highlighters-HowTo.htm explains the basic steps.  You need to create a grammar file and then SynGen.exe will generate your highlighter.

Edited by pyscripter
  • Like 2

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this