This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

LMD SyntaxEdit: How to get physical line in the OnGutterPaint event?

I have an event handler for the OnGutterPaintEvent.
The TLMDGutterPaintParams record has a field ScreenLine. 

My task is to convert this ScreenLine to a physical line for my document in the editor. 
Then I check if it is a modified line, and if so does some custom color painting in the gutter area (yellow for a modified line, and lime for a modified and saved line).

There is a ScreenToPhysical function but it is inside TScreenCache.
The edit view holds a field FScreenCache but it is private.

So I cannot directly access it from my edit view, if I understand it correctly (without changing your source code at least).

Have you got any suggestions?

I'm using Delphi 12 (update 1).

Thanks for any help!

Best regards

Christer

Comments

  • Hi, you can do it like this:

      ScrollLine := ScreenLine + MyEditView.TopLineScroll;
      PhysLine  := MyEditView.ScrollToPhysical(ScrollLine);
Sign In or Register to comment.