SynEdit: Fix tab-indent of line-mode-selection (last line was ignored, if caret.y=1). Part of issue #39998

This commit is contained in:
Martin 2023-03-05 14:10:43 +01:00
parent afb620fe49
commit bb62b8f64d

View File

@ -2751,7 +2751,13 @@ end;
function TSynEditSelection.GetLastLineHasSelection: Boolean;
begin
Result := (LastLineBytePos.x > 1) or ((FActiveSelectionMode = smLine) and FForceSingleLineSelected);
Result := (LastLineBytePos.x > 1) or
( (FActiveSelectionMode = smLine) and
( FForceSingleLineSelected or // Selection may be zero lenght, but will be entire line
(FEndLinePos <> FStartLinePos) or // Any selection in line-mode covers the last line
(FEndBytePos <> FStartBytePos)
)
);
end;
function TSynEditSelection.GetColumnLeftCharPos: Integer;