Martin how can use the property TextBetweenPoints to exchange lines. I tried but not work me.
I have this code:
tempStr := ASynEdit.LineText;
ASynEdit.TextBetweenPoints[Point(1, ASynEdit.CaretY), Point(1, ASynEdit.CaretY)]:= ASynEdit.Lines.Strings[ASynEdit.CaretY - 2] +LineEnding;
ASynEdit.TextBetweenPoints[Point(1, ASynEdit.CaretY-1), Point(1, ASynEdit.CaretY-1)]:=tempStr+LineEnding;previously used this code:
procedure MoveLineUp(Sender: TObject);
begin
if CustSynEdit.CaretY -1 >= 1 then
begin
CustSynEdit.Lines.Exchange(CustSynEdit.CaretY -1 ,CustSynEdit.CaretY-2);
CustSynEdit.CaretY:=CustSynEdit.CaretY-1;
end;
end;
procedure MoveLineDown(Sender: TObject);
begin
if ( CustSynEdit.CaretY + 1 <= CustSynEdit.Lines.Count) then
begin
CustSynEdit.Lines.Exchange(CustSynEdit.CaretY-1,CustSynEdit.CaretY);
CustSynEdit.CaretY:=CustSynEdit.CaretY+1;
end;
end;which has the same problem as you pointed out to me.
thanks.
