mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 21:59:16 +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
|
end else begin
|
||||||
BB := BlockBegin;
|
BB := BlockBegin;
|
||||||
BE := BlockEnd;
|
BE := BlockEnd;
|
||||||
if (BE.X = 1)
|
if FBlockSelection.LastLineHasSelection
|
||||||
then e := BE.y - 1
|
then e := BE.y
|
||||||
else e := BE.y;
|
else e := BE.y - 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Spaces := StringOfChar(#32, FBlockIndent);
|
Spaces := StringOfChar(#32, FBlockIndent);
|
||||||
@ -8237,10 +8237,10 @@ begin
|
|||||||
BB := BlockBegin;
|
BB := BlockBegin;
|
||||||
BE := BlockEnd;
|
BE := BlockEnd;
|
||||||
// convert selection to complete lines
|
// convert selection to complete lines
|
||||||
if BE.X = 1 then
|
if FBlockSelection.LastLineHasSelection then
|
||||||
e := BE.y - 1
|
e := BE.y
|
||||||
else
|
else
|
||||||
e := BE.y;
|
e := BE.y - 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
IncPaintLock;
|
IncPaintLock;
|
||||||
|
@ -123,6 +123,7 @@ type
|
|||||||
function AdjustBytePosToCharacterStart(Line: integer; BytePos: integer): integer;
|
function AdjustBytePosToCharacterStart(Line: integer; BytePos: integer): integer;
|
||||||
function GetFirstLineBytePos: TPoint;
|
function GetFirstLineBytePos: TPoint;
|
||||||
function GetLastLineBytePos: TPoint;
|
function GetLastLineBytePos: TPoint;
|
||||||
|
function GetLastLineHasSelection: Boolean;
|
||||||
procedure SetAutoExtend(AValue: Boolean);
|
procedure SetAutoExtend(AValue: Boolean);
|
||||||
procedure SetCaret(const AValue: TSynEditCaret);
|
procedure SetCaret(const AValue: TSynEditCaret);
|
||||||
procedure SetEnabled(const Value : Boolean);
|
procedure SetEnabled(const Value : Boolean);
|
||||||
@ -186,6 +187,7 @@ type
|
|||||||
// First and Last Pos are ordered according to the text flow (LTR)
|
// First and Last Pos are ordered according to the text flow (LTR)
|
||||||
property FirstLineBytePos: TPoint read GetFirstLineBytePos;
|
property FirstLineBytePos: TPoint read GetFirstLineBytePos;
|
||||||
property LastLineBytePos: TPoint read GetLastLineBytePos;
|
property LastLineBytePos: TPoint read GetLastLineBytePos;
|
||||||
|
property LastLineHasSelection: Boolean read GetLastLineHasSelection;
|
||||||
property InvalidateLinesMethod : TInvalidateLines write FInvalidateLinesMethod;
|
property InvalidateLinesMethod : TInvalidateLines write FInvalidateLinesMethod;
|
||||||
property Caret: TSynEditCaret read FCaret write SetCaret;
|
property Caret: TSynEditCaret read FCaret write SetCaret;
|
||||||
property Persistent: Boolean read FPersistent write SetPersistent;
|
property Persistent: Boolean read FPersistent write SetPersistent;
|
||||||
@ -2362,6 +2364,11 @@ begin
|
|||||||
Result := EndLineBytePos;
|
Result := EndLineBytePos;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSynEditSelection.GetLastLineHasSelection: Boolean;
|
||||||
|
begin
|
||||||
|
Result := (LastLineBytePos.x > 1) or ((FActiveSelectionMode = smLine) and FForceSingleLineSelected);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSynEditSelection.SetAutoExtend(AValue: Boolean);
|
procedure TSynEditSelection.SetAutoExtend(AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
if FAutoExtend = AValue then Exit;
|
if FAutoExtend = AValue then Exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user