SynEdit: fix adjusting empty/backward selection for SetTextBetweenPoints

git-svn-id: trunk@61677 -
This commit is contained in:
martin 2019-08-10 18:54:06 +00:00
parent 4bc787b833
commit 8e33ddad91

View File

@ -1843,14 +1843,21 @@ procedure TSynEditSelection.DoLinesEdited(Sender: TSynEditStrings; aLinePos, aBy
end;
end;
var
empty, back: Boolean;
begin
if FIsSettingText then exit;
if FPersistent or (FPersistentLock > 0) or
((FCaret <> nil) and (not FCaret.Locked))
then begin
if FActiveSelectionMode <> smColumn then begin // TODO: adjust ypos, height in smColumn mode
AdjustStartLineBytePos(AdjustPoint(StartLineBytePos, True));
EndLineBytePos := AdjustPoint(EndLineBytePos, False);
empty := (FStartBytePos = FEndBytePos) and (FStartLinePos = FEndLinePos);
back := IsBackwardSel;
AdjustStartLineBytePos(AdjustPoint(StartLineBytePos, not back));
if empty then
EndLineBytePos := StartLineBytePos
else
EndLineBytePos := AdjustPoint(EndLineBytePos, back);
end;
// Todo: Change Lines in smColumn
end