Code: Select all
...
y := Document.CursorY;
if (y < Document.LineCount - 1) then
Document.SetSelection(0, y, 0 , y+1)
else
Document.SetSelection(Length(Document.Lines[y-1]), y-1, Length(Document.Lines[y]), y);
Document.SelText := '';
...