Recent

Author Topic: [SynEdit]let's discuss about identation guide lines  (Read 3695 times)

Basile B.

  • Guest
[SynEdit]let's discuss about identation guide lines
« on: December 12, 2014, 11:14:48 am »
Any ideas about how implementing this ?

Yesterday I've given a short try with a naive aproach:
- new TSynHighlighterAttributes using dotted left frame, otherwise similar to white attributes.
- when lexing in Next(): i count the whites chars and according to the TabulationWidth I set either the token attribs to WhiteAttribs or to IdentLinesAttribs...

But it' doesn't work well, because of the empty lines which break the guide lines. Another Problem is that the tab width is a TSynEdit property, not an TSynHighligther one...
« Last Edit: December 12, 2014, 11:27:32 am by Basile B. »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: [SynEdit]let's discuss about identation guide lines
« Reply #1 on: December 12, 2014, 06:11:43 pm »
In Unit "SynEditTextTabExpander"

add a new derived class of "TLazSynDisplayViewEx", like   "TLazSynDisplayFold = class(TLazSynDisplayViewEx)"  (in SynEditFoldedView)

This returns the token for painting, and can filter, modify, and add tokens. (though adding will affect the "[...]" on a forded line).

See "TLazSynDisplayFold" which does add the "[...]".

Modify ATokenInfo: TLazSynDisplayTokenInfo to have a single border where you need it (you may have to break a token, which is a lot of work, if you consider Bidi (Rtl/Ltr).
Or instead of breaking, add having lines in the middle of the token

The other option is to add a new TSynEditMarkup. But that can not append at the end of line. Though such ability could be added.

-----------
Sorry, this is rather abstract. But I dont have the time to look deeper now.

IMHO the 1st solution sounds right, it is a feature of the tab module.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: [SynEdit]let's discuss about identation guide lines
« Reply #2 on: February 17, 2015, 11:15:34 am »
1) You can always put SynEdit on a form, and try to reproduce there.

2) You can open ide/lazarus.lpi. Then use Run, and debug the entire IDE (2 ide running, one debugging, and one being debugged)

3) add debugln, and use --debug-log=logfiile.txt
(Or compile the IDE with -WC (console) and watch there)

 

TinyPortal © 2005-2018