Alexey-T / ATSynEdit

Multi-line editor control, with syntax highlighting, for Lazarus
Other
156 stars 38 forks source link

Highlighting the current line #179

Closed EganSolo closed 6 years ago

EganSolo commented 7 years ago

Alexey,

What's the easiest way to get TATSynEdit to behave like the error message window in Lazarus and to highlight the line from one side of the window to the other, instead of highlighting the portion which contains text.

If I write this:

procedure Tfrm_TagEditor.ATSynEdit1CalcHilite(Sender: TObject;
  var AParts: TATLineParts; ALineIndex, ACharIndex, ALineLen: integer;
  var AColorAfterEol: TColor);
begin
  If aLineIndex = ATSynEdit1.Carets[0].PosY
  then with aParts[0] do
       begin
         ColorBG   := clRed;
         ColorFont := clWhite;
         aParts[0].Len := aLineLen;
       end;
end;

then I get this: text_highlighted

but what I really want is this line_highlighted

Alexey-T commented 7 years ago

Im Alexey.

a) better to use bookmark (with red color), not hilite. Strings.LinesBm[i]:= .... b) or try option OptShowFullWidthForSyntaxHilite

Alexey-T commented 7 years ago

ops, b) is not OK, don't work,

c) in adapter, you can set param for "color after line end" to clRed.