mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 14:05:58 +02:00
SynEdit: Added checks for revision 59971 #6bedb95bcd (fix selection with smLine should include folded lines - Issue #0034760) - apply only if AutoExtend is true (indicates user input key/mouse) / Setting Selection from code should not be affected.
git-svn-id: trunk@59983 -
This commit is contained in:
parent
0149572394
commit
f3eefeade7
@ -3301,7 +3301,9 @@ begin
|
|||||||
if (AnAction.Option <> emcoSelectionContinue) or (not SelAvail) then
|
if (AnAction.Option <> emcoSelectionContinue) or (not SelAvail) then
|
||||||
FBlockSelection.StartLineBytePos := FCaret.LineBytePos;
|
FBlockSelection.StartLineBytePos := FCaret.LineBytePos;
|
||||||
FBlockSelection.ActiveSelectionMode := smLine;
|
FBlockSelection.ActiveSelectionMode := smLine;
|
||||||
|
FBlockSelection.AutoExtend := True;
|
||||||
FBlockSelection.ForceSingleLineSelected := True;
|
FBlockSelection.ForceSingleLineSelected := True;
|
||||||
|
FBlockSelection.AutoExtend := AnAction.Option = emcoSelectionContinue;
|
||||||
end;
|
end;
|
||||||
emcStartSelectTokens, emcStartSelectWords, emcStartSelectLines: begin
|
emcStartSelectTokens, emcStartSelectWords, emcStartSelectLines: begin
|
||||||
FMouseSelectionCmd := ACommand;
|
FMouseSelectionCmd := ACommand;
|
||||||
|
@ -2272,7 +2272,8 @@ begin
|
|||||||
Value.y := MinMax(Value.y, 1, fLines.Count);
|
Value.y := MinMax(Value.y, 1, fLines.Count);
|
||||||
|
|
||||||
// ensure folded block at bottom line is in selection
|
// ensure folded block at bottom line is in selection
|
||||||
if (ActiveSelectionMode = smLine) and (FFoldedView <> nil)
|
if (ActiveSelectionMode = smLine) and (FFoldedView <> nil) and
|
||||||
|
(FAutoExtend or FStickyAutoExtend)
|
||||||
then begin
|
then begin
|
||||||
if ( (FStartLinePos > Value.y) or
|
if ( (FStartLinePos > Value.y) or
|
||||||
( (FStartLinePos = Value.y) and (FStartBytePos > Value.x) )
|
( (FStartLinePos = Value.y) and (FStartBytePos > Value.x) )
|
||||||
@ -2351,7 +2352,7 @@ begin
|
|||||||
if WasAvail <> SelAvail then begin
|
if WasAvail <> SelAvail then begin
|
||||||
// ensure folded block at bottom line is in selection
|
// ensure folded block at bottom line is in selection
|
||||||
// only when selection is new (WasAvail = False)
|
// only when selection is new (WasAvail = False)
|
||||||
if SelAvail then begin
|
if SelAvail and (FAutoExtend or FStickyAutoExtend) then begin
|
||||||
if IsBackwardSel then
|
if IsBackwardSel then
|
||||||
FStartLinePos := TSynEditFoldedView(FFoldedView).TextPosAddLines(FStartLinePos, 1) - 1
|
FStartLinePos := TSynEditFoldedView(FFoldedView).TextPosAddLines(FStartLinePos, 1) - 1
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user