mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 10:49:27 +02:00
SynEdit: fixed (un-)indent selection in linemode (select via gutter). Issue #0029591
git-svn-id: trunk@51578 -
This commit is contained in:
parent
fef0aed03e
commit
a564fde4c8
@ -8172,9 +8172,9 @@ begin
|
||||
end else begin
|
||||
BB := BlockBegin;
|
||||
BE := BlockEnd;
|
||||
if (BE.X = 1)
|
||||
then e := BE.y - 1
|
||||
else e := BE.y;
|
||||
if FBlockSelection.LastLineHasSelection
|
||||
then e := BE.y
|
||||
else e := BE.y - 1;
|
||||
end;
|
||||
|
||||
Spaces := StringOfChar(#32, FBlockIndent);
|
||||
@ -8237,10 +8237,10 @@ begin
|
||||
BB := BlockBegin;
|
||||
BE := BlockEnd;
|
||||
// convert selection to complete lines
|
||||
if BE.X = 1 then
|
||||
e := BE.y - 1
|
||||
if FBlockSelection.LastLineHasSelection then
|
||||
e := BE.y
|
||||
else
|
||||
e := BE.y;
|
||||
e := BE.y - 1;
|
||||
end;
|
||||
|
||||
IncPaintLock;
|
||||
|
@ -123,6 +123,7 @@ type
|
||||
function AdjustBytePosToCharacterStart(Line: integer; BytePos: integer): integer;
|
||||
function GetFirstLineBytePos: TPoint;
|
||||
function GetLastLineBytePos: TPoint;
|
||||
function GetLastLineHasSelection: Boolean;
|
||||
procedure SetAutoExtend(AValue: Boolean);
|
||||
procedure SetCaret(const AValue: TSynEditCaret);
|
||||
procedure SetEnabled(const Value : Boolean);
|
||||
@ -186,6 +187,7 @@ type
|
||||
// First and Last Pos are ordered according to the text flow (LTR)
|
||||
property FirstLineBytePos: TPoint read GetFirstLineBytePos;
|
||||
property LastLineBytePos: TPoint read GetLastLineBytePos;
|
||||
property LastLineHasSelection: Boolean read GetLastLineHasSelection;
|
||||
property InvalidateLinesMethod : TInvalidateLines write FInvalidateLinesMethod;
|
||||
property Caret: TSynEditCaret read FCaret write SetCaret;
|
||||
property Persistent: Boolean read FPersistent write SetPersistent;
|
||||
@ -2362,6 +2364,11 @@ begin
|
||||
Result := EndLineBytePos;
|
||||
end;
|
||||
|
||||
function TSynEditSelection.GetLastLineHasSelection: Boolean;
|
||||
begin
|
||||
Result := (LastLineBytePos.x > 1) or ((FActiveSelectionMode = smLine) and FForceSingleLineSelected);
|
||||
end;
|
||||
|
||||
procedure TSynEditSelection.SetAutoExtend(AValue: Boolean);
|
||||
begin
|
||||
if FAutoExtend = AValue then Exit;
|
||||
|
Loading…
Reference in New Issue
Block a user