Recent

Author Topic: TSynEdit, TSynHighlighters and code folding  (Read 5728 times)

kormoran

  • New Member
  • *
  • Posts: 31
TSynEdit, TSynHighlighters and code folding
« on: March 26, 2011, 10:10:38 pm »
I discovered the TSynEdit and TSynHighlighters controls, using TSynXMLSyn for highlight the XML syntax... really great, LCL rocks!  8)

Now that I have a fancy XML editor, I would like to fold parts of XML structure (like the code in Lazarus IDE does):  I read the "SynEdit Highlighter" page on the wiki that cover this argument too, but it's not very clear on it.

Can anyone help me? How do I do, exactly?

thanks

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10997
  • Debugger - SynEdit - and more
    • wiki
Re: TSynEdit, TSynHighlighters and code folding
« Reply #1 on: March 27, 2011, 12:02:17 am »
SynEdit is not part of the LCL, it's a separate package... but that only to be over-correct ;) 

If you download the latest Lazarus (0.9.29 / 0.9.30 or 0.9.31) => the xml highlighter included already supports folding.


To make sure:
The purpose of http://wiki.lazarus.freepascal.org/SynEdit_Highlighter is not to be a full tutorial.

It simply provides examples that demonstrate the most important methods of the highlighter class.


Otherwise: what exactly is not very clear on this page?

kormoran

  • New Member
  • *
  • Posts: 31
Re: TSynEdit, TSynHighlighters and code folding
« Reply #2 on: March 27, 2011, 12:21:57 am »
Well... actually I tought that folding support was already in place and didn't expected to build it myself, so THAT made things unclear... I was looking for a quick "call this and this proc" and obviously that was not the case  :-[

I have Lazarus 0.9.28.2, I think I'll upgrade in the next few minutes

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10997
  • Debugger - SynEdit - and more
    • wiki
Re: TSynEdit, TSynHighlighters and code folding
« Reply #3 on: March 27, 2011, 12:57:00 am »
Well folding support is already build in.

in 0.9.29/0.9.30 folding works for pascal, xml, html, diff, lfm.
in 0,9.28[.2] it does not for all of them.

I just dropped a synedit on an empty form, dropped an xml-highlighter, added the highlighter to synedit, and filed in some XML

=> folding was all there....

So if you use 0.9.30, please give some more details, or post a *small* sample project.


There is actually no documentation on how to configure existing folding. But the synedit testcase does some of it, so you can look there.


 

TinyPortal © 2005-2018