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:
martin 2019-01-03 18:10:15 +00:00
parent 0149572394
commit f3eefeade7
2 changed files with 5 additions and 2 deletions

View File

@ -3301,7 +3301,9 @@ begin
if (AnAction.Option <> emcoSelectionContinue) or (not SelAvail) then
FBlockSelection.StartLineBytePos := FCaret.LineBytePos;
FBlockSelection.ActiveSelectionMode := smLine;
FBlockSelection.AutoExtend := True;
FBlockSelection.ForceSingleLineSelected := True;
FBlockSelection.AutoExtend := AnAction.Option = emcoSelectionContinue;
end;
emcStartSelectTokens, emcStartSelectWords, emcStartSelectLines: begin
FMouseSelectionCmd := ACommand;

View File

@ -2272,7 +2272,8 @@ begin
Value.y := MinMax(Value.y, 1, fLines.Count);
// 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
if ( (FStartLinePos > Value.y) or
( (FStartLinePos = Value.y) and (FStartBytePos > Value.x) )
@ -2351,7 +2352,7 @@ begin
if WasAvail <> SelAvail then begin
// ensure folded block at bottom line is in selection
// only when selection is new (WasAvail = False)
if SelAvail then begin
if SelAvail and (FAutoExtend or FStickyAutoExtend) then begin
if IsBackwardSel then
FStartLinePos := TSynEditFoldedView(FFoldedView).TextPosAddLines(FStartLinePos, 1) - 1
else