mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 02:39:15 +02:00
SynEdit: Enhanced horiz scrolling, when reaching border while typing/backspacing
git-svn-id: trunk@63216 -
This commit is contained in:
parent
c97a2a7c76
commit
6ad0380fb1
@ -218,7 +218,7 @@ type
|
|||||||
TSynEditTextFlags = set of TSynEditTextFlag;
|
TSynEditTextFlags = set of TSynEditTextFlag;
|
||||||
|
|
||||||
TSynStateFlag = (sfCaretChanged, sfHideCursor,
|
TSynStateFlag = (sfCaretChanged, sfHideCursor,
|
||||||
sfEnsureCursorPos, sfEnsureCursorPosAtResize,
|
sfEnsureCursorPos, sfEnsureCursorPosAtResize, sfEnsureCursorPosForEditRight, sfEnsureCursorPosForEditLeft,
|
||||||
sfExplicitTopLine, sfExplicitLeftChar, // when doing EnsureCursorPos keep top/Left, if they where set explicitly after the caret (only applies before handle creation)
|
sfExplicitTopLine, sfExplicitLeftChar, // when doing EnsureCursorPos keep top/Left, if they where set explicitly after the caret (only applies before handle creation)
|
||||||
sfPreventScrollAfterSelect,
|
sfPreventScrollAfterSelect,
|
||||||
sfIgnoreNextChar, sfPainting, sfHasPainted, sfHasScrolled,
|
sfIgnoreNextChar, sfPainting, sfHasPainted, sfHasScrolled,
|
||||||
@ -466,6 +466,63 @@ type
|
|||||||
swbWordSmart // begin or end of word with smart gaps (1 char)
|
swbWordSmart // begin or end of word with smart gaps (1 char)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
{ TSynScrollOnEditOptions }
|
||||||
|
|
||||||
|
TSynScrollOnEditOptions = class(TPersistent)
|
||||||
|
private
|
||||||
|
FKeepBorderDistance: integer;
|
||||||
|
FKeepBorderDistancePercent: integer;
|
||||||
|
FOnChange: TNotifyEvent;
|
||||||
|
FScrollExtraColumns: integer;
|
||||||
|
FScrollExtraMax: integer;
|
||||||
|
FScrollExtraPercent: integer;
|
||||||
|
procedure SetKeepBorderDistance(AValue: integer);
|
||||||
|
procedure SetKeepBorderDistancePercent(AValue: integer);
|
||||||
|
procedure SetScrollExtraColumns(AValue: integer);
|
||||||
|
procedure SetScrollExtraMax(AValue: integer);
|
||||||
|
procedure SetScrollExtraPercent(AValue: integer);
|
||||||
|
protected
|
||||||
|
FCurrentDistance: integer;
|
||||||
|
FCurrentColumns: integer;
|
||||||
|
procedure Assign(Source: TPersistent); override;
|
||||||
|
public
|
||||||
|
constructor Create;
|
||||||
|
procedure SetDefaults; virtual;
|
||||||
|
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
||||||
|
|
||||||
|
property KeepBorderDistance: integer read FKeepBorderDistance write SetKeepBorderDistance;
|
||||||
|
property KeepBorderDistancePercent: integer read FKeepBorderDistancePercent write SetKeepBorderDistancePercent;
|
||||||
|
property ScrollExtraColumns: integer read FScrollExtraColumns write SetScrollExtraColumns;
|
||||||
|
property ScrollExtraPercent: integer read FScrollExtraPercent write SetScrollExtraPercent;
|
||||||
|
property ScrollExtraMax: integer read FScrollExtraMax write SetScrollExtraMax;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TSynScrollOnEditLeftOptions }
|
||||||
|
|
||||||
|
TSynScrollOnEditLeftOptions = class(TSynScrollOnEditOptions)
|
||||||
|
public
|
||||||
|
procedure SetDefaults; override;
|
||||||
|
published
|
||||||
|
property KeepBorderDistance default 2;
|
||||||
|
property KeepBorderDistancePercent default 0;
|
||||||
|
property ScrollExtraColumns default 5;
|
||||||
|
property ScrollExtraPercent default 10;
|
||||||
|
property ScrollExtraMax default 20;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TSynScrollOnEditRightOptions }
|
||||||
|
|
||||||
|
TSynScrollOnEditRightOptions = class(TSynScrollOnEditOptions)
|
||||||
|
public
|
||||||
|
procedure SetDefaults; override;
|
||||||
|
published
|
||||||
|
property KeepBorderDistance default 0;
|
||||||
|
property KeepBorderDistancePercent default 0;
|
||||||
|
property ScrollExtraColumns default 10;
|
||||||
|
property ScrollExtraPercent default 25;
|
||||||
|
property ScrollExtraMax default 20;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TCustomSynEdit }
|
{ TCustomSynEdit }
|
||||||
|
|
||||||
TCustomSynEdit = class(TSynEditBase)
|
TCustomSynEdit = class(TSynEditBase)
|
||||||
@ -498,6 +555,8 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure CMWantSpecialKey(var Message: TLMessage); message CM_WANTSPECIALKEY;
|
procedure CMWantSpecialKey(var Message: TLMessage); message CM_WANTSPECIALKEY;
|
||||||
private
|
private
|
||||||
|
FScrollOnEditLeftOptions: TSynScrollOnEditOptions;
|
||||||
|
FScrollOnEditRightOptions: TSynScrollOnEditOptions;
|
||||||
FTextCursor, FOffTextCursor, FOverrideCursor: TCursor;
|
FTextCursor, FOffTextCursor, FOverrideCursor: TCursor;
|
||||||
FBlockIndent: integer;
|
FBlockIndent: integer;
|
||||||
FBlockTabIndent: integer;
|
FBlockTabIndent: integer;
|
||||||
@ -629,6 +688,8 @@ type
|
|||||||
FPendingFoldState: String;
|
FPendingFoldState: String;
|
||||||
|
|
||||||
procedure DoTopViewChanged(Sender: TObject);
|
procedure DoTopViewChanged(Sender: TObject);
|
||||||
|
procedure SetScrollOnEditLeftOptions(AValue: TSynScrollOnEditOptions);
|
||||||
|
procedure SetScrollOnEditRightOptions(AValue: TSynScrollOnEditOptions);
|
||||||
procedure UpdateScreenCaret;
|
procedure UpdateScreenCaret;
|
||||||
procedure AquirePrimarySelection;
|
procedure AquirePrimarySelection;
|
||||||
function GetChangeStamp: int64;
|
function GetChangeStamp: int64;
|
||||||
@ -782,6 +843,7 @@ type
|
|||||||
procedure SetWordBlock(Value: TPoint);
|
procedure SetWordBlock(Value: TPoint);
|
||||||
procedure SetLineBlock(Value: TPoint; WithLeadSpaces: Boolean = True);
|
procedure SetLineBlock(Value: TPoint; WithLeadSpaces: Boolean = True);
|
||||||
procedure SetParagraphBlock(Value: TPoint);
|
procedure SetParagraphBlock(Value: TPoint);
|
||||||
|
procedure RecalcScrollOnEdit(Sender: TObject);
|
||||||
procedure RecalcCharsAndLinesInWin(CheckCaret: Boolean);
|
procedure RecalcCharsAndLinesInWin(CheckCaret: Boolean);
|
||||||
procedure StatusChangedEx(Sender: TObject; Changes: TSynStatusChanges);
|
procedure StatusChangedEx(Sender: TObject; Changes: TSynStatusChanges);
|
||||||
procedure StatusChanged(AChanges: TSynStatusChanges);
|
procedure StatusChanged(AChanges: TSynStatusChanges);
|
||||||
@ -1154,6 +1216,9 @@ type
|
|||||||
property MaxLeftChar: integer read fMaxLeftChar write SetMaxLeftChar default 1024;
|
property MaxLeftChar: integer read fMaxLeftChar write SetMaxLeftChar default 1024;
|
||||||
property TopLine: Integer read GetTopLine write SetTopLine;
|
property TopLine: Integer read GetTopLine write SetTopLine;
|
||||||
|
|
||||||
|
property ScrollOnEditLeftOptions: TSynScrollOnEditOptions read FScrollOnEditLeftOptions write SetScrollOnEditLeftOptions;
|
||||||
|
property ScrollOnEditRightOptions: TSynScrollOnEditOptions read FScrollOnEditRightOptions write SetScrollOnEditRightOptions;
|
||||||
|
|
||||||
property UseIncrementalColor : Boolean write SetUseIncrementalColor;
|
property UseIncrementalColor : Boolean write SetUseIncrementalColor;
|
||||||
property Modified: Boolean read GetModified write SetModified;
|
property Modified: Boolean read GetModified write SetModified;
|
||||||
property PaintLock: Integer read fPaintLock;
|
property PaintLock: Integer read fPaintLock;
|
||||||
@ -1341,6 +1406,8 @@ type
|
|||||||
property RightEdgeColor;
|
property RightEdgeColor;
|
||||||
property ScrollBars;
|
property ScrollBars;
|
||||||
property SelectedColor;
|
property SelectedColor;
|
||||||
|
property ScrollOnEditLeftOptions;
|
||||||
|
property ScrollOnEditRightOptions;
|
||||||
property IncrementColor;
|
property IncrementColor;
|
||||||
property HighlightAllColor;
|
property HighlightAllColor;
|
||||||
property BracketHighlightStyle;
|
property BracketHighlightStyle;
|
||||||
@ -1767,6 +1834,90 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TSynScrollOnEditOptions }
|
||||||
|
|
||||||
|
procedure TSynScrollOnEditOptions.SetKeepBorderDistance(AValue: integer);
|
||||||
|
begin
|
||||||
|
if FKeepBorderDistance = AValue then Exit;
|
||||||
|
AValue := MinMax(AValue, 0, 1000);
|
||||||
|
FKeepBorderDistance := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSynScrollOnEditOptions.SetKeepBorderDistancePercent(AValue: integer);
|
||||||
|
begin
|
||||||
|
if FKeepBorderDistancePercent = AValue then Exit;
|
||||||
|
AValue := MinMax(AValue, 0, 100);
|
||||||
|
FKeepBorderDistancePercent := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSynScrollOnEditOptions.SetScrollExtraColumns(AValue: integer);
|
||||||
|
begin
|
||||||
|
if FScrollExtraColumns = AValue then Exit;
|
||||||
|
AValue := MinMax(AValue, 0, 1000);
|
||||||
|
FScrollExtraColumns := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSynScrollOnEditOptions.SetScrollExtraMax(AValue: integer);
|
||||||
|
begin
|
||||||
|
if FScrollExtraMax = AValue then Exit;
|
||||||
|
AValue := MinMax(AValue, 0, 1000);
|
||||||
|
FScrollExtraMax := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSynScrollOnEditOptions.SetScrollExtraPercent(AValue: integer);
|
||||||
|
begin
|
||||||
|
if FScrollExtraPercent = AValue then Exit;
|
||||||
|
AValue := MinMax(AValue, 0, 100);
|
||||||
|
FScrollExtraPercent := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSynScrollOnEditOptions.Assign(Source: TPersistent);
|
||||||
|
begin
|
||||||
|
if not(Source is TSynScrollOnEditOptions) then
|
||||||
|
exit;
|
||||||
|
FKeepBorderDistance := TSynScrollOnEditOptions(Source).FKeepBorderDistance;
|
||||||
|
FKeepBorderDistancePercent := TSynScrollOnEditOptions(Source).FKeepBorderDistancePercent;
|
||||||
|
FScrollExtraColumns := TSynScrollOnEditOptions(Source).FScrollExtraColumns;
|
||||||
|
FScrollExtraMax := TSynScrollOnEditOptions(Source).FScrollExtraMax;
|
||||||
|
FScrollExtraPercent := TSynScrollOnEditOptions(Source).FScrollExtraPercent;
|
||||||
|
if Assigned(FOnChange) then
|
||||||
|
FOnChange(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TSynScrollOnEditOptions.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
SetDefaults;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSynScrollOnEditOptions.SetDefaults;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TSynScrollOnEditLeftOptions }
|
||||||
|
|
||||||
|
procedure TSynScrollOnEditLeftOptions.SetDefaults;
|
||||||
|
begin
|
||||||
|
inherited SetDefaults;
|
||||||
|
FKeepBorderDistance := 2;
|
||||||
|
FKeepBorderDistancePercent := 0;
|
||||||
|
FScrollExtraColumns := 5;
|
||||||
|
FScrollExtraMax := 10;
|
||||||
|
FScrollExtraPercent := 20;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TSynScrollOnEditRightOptions }
|
||||||
|
|
||||||
|
procedure TSynScrollOnEditRightOptions.SetDefaults;
|
||||||
|
begin
|
||||||
|
FKeepBorderDistance := 0;
|
||||||
|
FKeepBorderDistancePercent := 0;
|
||||||
|
FScrollExtraColumns := 10;
|
||||||
|
FScrollExtraMax := 25;
|
||||||
|
FScrollExtraPercent := 30;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TCustomSynEdit }
|
{ TCustomSynEdit }
|
||||||
|
|
||||||
procedure TCustomSynEdit.AquirePrimarySelection;
|
procedure TCustomSynEdit.AquirePrimarySelection;
|
||||||
@ -2086,6 +2237,20 @@ begin
|
|||||||
FTextArea.TheLinesView := FTheLinesView;
|
FTextArea.TheLinesView := FTheLinesView;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomSynEdit.SetScrollOnEditLeftOptions(
|
||||||
|
AValue: TSynScrollOnEditOptions);
|
||||||
|
begin
|
||||||
|
FScrollOnEditLeftOptions.Assign(AValue);
|
||||||
|
RecalcScrollOnEdit(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomSynEdit.SetScrollOnEditRightOptions(
|
||||||
|
AValue: TSynScrollOnEditOptions);
|
||||||
|
begin
|
||||||
|
FScrollOnEditRightOptions.Assign(AValue);
|
||||||
|
RecalcScrollOnEdit(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TCustomSynEdit.Create(AOwner: TComponent);
|
constructor TCustomSynEdit.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
@ -2200,6 +2365,10 @@ begin
|
|||||||
FFoldedLinesView.BlockSelection := FBlockSelection;
|
FFoldedLinesView.BlockSelection := FBlockSelection;
|
||||||
|
|
||||||
FWordBreaker := TSynWordBreaker.Create;
|
FWordBreaker := TSynWordBreaker.Create;
|
||||||
|
FScrollOnEditLeftOptions := TSynScrollOnEditLeftOptions.Create;
|
||||||
|
FScrollOnEditLeftOptions.OnChange := @RecalcScrollOnEdit;
|
||||||
|
FScrollOnEditRightOptions := TSynScrollOnEditRightOptions.Create;
|
||||||
|
FScrollOnEditRightOptions.OnChange := @RecalcScrollOnEdit;
|
||||||
|
|
||||||
RecreateMarkList;
|
RecreateMarkList;
|
||||||
|
|
||||||
@ -2632,6 +2801,9 @@ begin
|
|||||||
FreeAndNil(FKeyPressEventList);
|
FreeAndNil(FKeyPressEventList);
|
||||||
FreeAndNil(FQueryMouseCursorList);
|
FreeAndNil(FQueryMouseCursorList);
|
||||||
FreeAndNil(FUtf8KeyPressEventList);
|
FreeAndNil(FUtf8KeyPressEventList);
|
||||||
|
FreeAndNil(FScrollOnEditLeftOptions);
|
||||||
|
FreeAndNil(FScrollOnEditRightOptions);
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -6527,10 +6699,25 @@ begin
|
|||||||
' BlockX=',dbgs(PhysBlockBeginXY.X)+'-'+dbgs(PhysBlockEndXY.X),
|
' BlockX=',dbgs(PhysBlockBeginXY.X)+'-'+dbgs(PhysBlockEndXY.X),
|
||||||
' CharsInWindow='+dbgs(CharsInWindow), MinX='+dbgs(MinX),' MaxX='+dbgs(MaxX),
|
' CharsInWindow='+dbgs(CharsInWindow), MinX='+dbgs(MinX),' MaxX='+dbgs(MaxX),
|
||||||
' LeftChar='+dbgs(LeftChar), '');}
|
' LeftChar='+dbgs(LeftChar), '');}
|
||||||
if MinX < LeftChar then
|
MaxX := MaxX - (Max(1, CharsInWindow) - 1 - FScreenCaret.ExtraLineChars);
|
||||||
LeftChar := MinX
|
if (sfEnsureCursorPosForEditLeft in fStateFlags) then
|
||||||
else if LeftChar < MaxX - (Max(1, CharsInWindow) - 1 - FScreenCaret.ExtraLineChars) then
|
dec(MinX, FScrollOnEditLeftOptions.FCurrentDistance)
|
||||||
LeftChar := MaxX - (Max(1, CharsInWindow) - 1 - FScreenCaret.ExtraLineChars)
|
else
|
||||||
|
if (sfEnsureCursorPosForEditRight in fStateFlags) then
|
||||||
|
inc(MaxX, FScrollOnEditRightOptions.FCurrentDistance);
|
||||||
|
|
||||||
|
if MinX < LeftChar then begin
|
||||||
|
if sfEnsureCursorPosForEditLeft in fStateFlags then
|
||||||
|
MinX := Min(MinX,
|
||||||
|
PhysCaretXY.X - FScrollOnEditLeftOptions.FCurrentColumns);
|
||||||
|
LeftChar := MinX;
|
||||||
|
end
|
||||||
|
else if LeftChar < MaxX then begin
|
||||||
|
if sfEnsureCursorPosForEditRight in fStateFlags then
|
||||||
|
MaxX := Max(MaxX,
|
||||||
|
PhysCaretXY.X + FScrollOnEditRightOptions.FCurrentColumns - (Max(1, CharsInWindow) - 1 - FScreenCaret.ExtraLineChars));
|
||||||
|
LeftChar := MaxX;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
LeftChar := LeftChar; //mh 2000-10-19
|
LeftChar := LeftChar; //mh 2000-10-19
|
||||||
end;
|
end;
|
||||||
@ -6545,7 +6732,7 @@ begin
|
|||||||
TopView := TopView; //mh 2000-10-19
|
TopView := TopView; //mh 2000-10-19
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
Exclude(fStateFlags, sfPreventScrollAfterSelect);
|
fStateFlags := fStateFlags - [sfPreventScrollAfterSelect, sfEnsureCursorPosForEditRight, sfEnsureCursorPosForEditLeft];
|
||||||
finally
|
finally
|
||||||
DoDecPaintLock(Self);
|
DoDecPaintLock(Self);
|
||||||
//{BUG21996} DebugLnExit(['TCustomSynEdit.EnsureCursorPosVisible Caret=',dbgs(CaretXY),', BlockBegin=',dbgs(BlockBegin),' BlockEnd=',dbgs(BlockEnd), ' StateFlags=',dbgs(fStateFlags), ' paintlock', FPaintLock]);
|
//{BUG21996} DebugLnExit(['TCustomSynEdit.EnsureCursorPosVisible Caret=',dbgs(CaretXY),', BlockBegin=',dbgs(BlockBegin),' BlockEnd=',dbgs(BlockEnd), ' StateFlags=',dbgs(fStateFlags), ' paintlock', FPaintLock]);
|
||||||
@ -6889,6 +7076,7 @@ begin
|
|||||||
LogCounter := GetCharLen(Temp, LogCaretXY.X);
|
LogCounter := GetCharLen(Temp, LogCaretXY.X);
|
||||||
FTheLinesView.EditDelete(LogCaretXY.X, LogCaretXY.Y, LogCounter);
|
FTheLinesView.EditDelete(LogCaretXY.X, LogCaretXY.Y, LogCounter);
|
||||||
FCaret.BytePos := LogCaretXY.X;
|
FCaret.BytePos := LogCaretXY.X;
|
||||||
|
Include(fStateFlags, sfEnsureCursorPosForEditLeft);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -7038,8 +7226,7 @@ begin
|
|||||||
|
|
||||||
//CaretX := CaretX + 1;
|
//CaretX := CaretX + 1;
|
||||||
FCaret.BytePos := LogCaretXY.X + length(AChar);
|
FCaret.BytePos := LogCaretXY.X + length(AChar);
|
||||||
if CaretX >= LeftChar + CharsInWindow then
|
Include(fStateFlags, sfEnsureCursorPosForEditRight);
|
||||||
LeftChar := LeftChar + Min(25, CharsInWindow - 1);
|
|
||||||
finally
|
finally
|
||||||
FCaret.DecForceAdjustToNextChar;
|
FCaret.DecForceAdjustToNextChar;
|
||||||
FCaret.DecForcePastEOL;
|
FCaret.DecForcePastEOL;
|
||||||
@ -8275,6 +8462,39 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomSynEdit.RecalcScrollOnEdit(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FScrollOnEditLeftOptions.FCurrentDistance := Min(Max(
|
||||||
|
FScrollOnEditLeftOptions.KeepBorderDistance,
|
||||||
|
CharsInWindow * FScrollOnEditLeftOptions.KeepBorderDistancePercent div 100
|
||||||
|
),
|
||||||
|
Max(0, CharsInWindow - 1) div 2
|
||||||
|
);
|
||||||
|
FScrollOnEditLeftOptions.FCurrentColumns := Min(Min(Max(
|
||||||
|
FScrollOnEditLeftOptions.ScrollExtraColumns,
|
||||||
|
CharsInWindow * FScrollOnEditLeftOptions.ScrollExtraPercent div 100
|
||||||
|
),
|
||||||
|
FScrollOnEditLeftOptions.ScrollExtraMax
|
||||||
|
),
|
||||||
|
Max(0, CharsInWindow - 1) div 2
|
||||||
|
);
|
||||||
|
|
||||||
|
FScrollOnEditRightOptions.FCurrentDistance := Min(Max(
|
||||||
|
FScrollOnEditRightOptions.KeepBorderDistance,
|
||||||
|
CharsInWindow * FScrollOnEditRightOptions.KeepBorderDistancePercent div 100
|
||||||
|
),
|
||||||
|
Max(0, CharsInWindow - 1) div 2
|
||||||
|
);
|
||||||
|
FScrollOnEditRightOptions.FCurrentColumns := Min(Min(Max(
|
||||||
|
FScrollOnEditRightOptions.ScrollExtraColumns,
|
||||||
|
CharsInWindow * FScrollOnEditRightOptions.ScrollExtraPercent div 100
|
||||||
|
),
|
||||||
|
FScrollOnEditRightOptions.ScrollExtraMax
|
||||||
|
),
|
||||||
|
Max(0, CharsInWindow - 1) div 2
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomSynEdit.RecalcCharsAndLinesInWin(CheckCaret: Boolean);
|
procedure TCustomSynEdit.RecalcCharsAndLinesInWin(CheckCaret: Boolean);
|
||||||
var
|
var
|
||||||
l, r: Integer;
|
l, r: Integer;
|
||||||
@ -8321,6 +8541,8 @@ begin
|
|||||||
if not (eoScrollPastEof in Options) then
|
if not (eoScrollPastEof in Options) then
|
||||||
TopView := TopView;
|
TopView := TopView;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
RecalcScrollOnEdit(nil);
|
||||||
finally
|
finally
|
||||||
DecStatusChangeLock;
|
DecStatusChangeLock;
|
||||||
end;
|
end;
|
||||||
@ -8569,6 +8791,7 @@ begin
|
|||||||
FCaret.IncAutoMoveOnEdit;
|
FCaret.IncAutoMoveOnEdit;
|
||||||
FTheLinesView.EditInsert(FCaret.BytePos, FCaret.LinePos, Spaces);
|
FTheLinesView.EditInsert(FCaret.BytePos, FCaret.LinePos, Spaces);
|
||||||
FCaret.DecAutoMoveOnEdit;
|
FCaret.DecAutoMoveOnEdit;
|
||||||
|
Include(fStateFlags, sfEnsureCursorPosForEditRight);
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
InternalEndUndoBlock;
|
InternalEndUndoBlock;
|
||||||
|
Loading…
Reference in New Issue
Block a user