SynEdit: cleanup, remove unused var

This commit is contained in:
Martin 2025-02-23 12:27:52 +01:00
parent 66f8a5dcb5
commit fb8fecd205
6 changed files with 7 additions and 24 deletions

View File

@ -3743,14 +3743,13 @@ function TCustomSynEdit.GetDragHotZoneInfo(x, y: Integer; out HorizFraction,
VertFraction: Integer): boolean;
var
b: TRect;
HotWidth, HotHeight: Integer;
HotWidth: Integer;
begin
HorizFraction := 0;
VertFraction := 0;
b := FTextArea.Bounds;
HotWidth := Min(LineHeight * 11 div 4, (b.Right - b.Left) div 4);
HotHeight := Min(LineHeight * 9 div 4, (b.Bottom - b.Top) div 4);
if x < b.Left + HotWidth then
HorizFraction := (x - (b.Left + HotWidth)) * 256 div HotWidth
@ -6611,9 +6610,7 @@ procedure TCustomSynEdit.DragDrop(Source: TObject; X, Y: Integer);
var
NewCaret: TPoint;
DropMove: boolean;
BB, BE: TPoint;
DragDropText: string;
Adjust: integer;
FoldInfo: String;
BlockSel: TSynEditSelection;
sm: TSynSelectionMode;
@ -6627,8 +6624,6 @@ begin
ComputeCaret(X, Y);
NewCaret := LogicalCaretXY;
if CheckDragDropAccecpt(NewCaret, Source, DropMove) then begin
BB := BlockBegin;
BE := BlockEnd;
InternalBeginUndoBlock; //mh 2000-11-20
try
DragDropText := TCustomSynEdit(Source).SelText;

View File

@ -2422,7 +2422,7 @@ procedure TSynTextFoldAVLTree.AdjustForLinesDeleted(AStartLine,
Procedure AdjustNodeForLinesDeleted(Current : TSynTextFoldAVLNodeData;
CurrentLine, FirstLineToDelete, CountLinesToDelete : Integer);
var
LastLineToDelete, LinesBefore, LinesInside, LinesAfter, t : Integer;
LastLineToDelete, LinesBefore, LinesInside, LinesAfter : Integer;
begin
LastLineToDelete := FirstLineToDelete + CountLinesToDelete - 1; // only valid for delete; CountLinesToDelete < 0
@ -2436,7 +2436,6 @@ procedure TSynTextFoldAVLTree.AdjustForLinesDeleted(AStartLine,
LinesBefore := CurrentLine - FirstLineToDelete;
LinesInside := CountLinesToDelete - LinesBefore;
// shrink
t := Current._MergedLineCount;
Current._FoldedCount := Max(Current._FoldedCount - LinesInside, -1);
Current._MergedLineCount := Max(Current._MergedLineCount - LinesInside, 0);
Current.UdpateVirtualLineCounts(FNextStrings, CurrentLine); // If LineCount = -1; LeftVirtualLineCount will be correctd on delete node
@ -2472,7 +2471,6 @@ procedure TSynTextFoldAVLTree.AdjustForLinesDeleted(AStartLine,
LinesInside := CountLinesToDelete - LinesAfter;
// shrink current node
t := Current._MergedLineCount;
Current._MergedLineCount := Current._MergedLineCount- LinesInside;
if Current._FoldedCount > Current._MergedLineCount then
Current._FoldedCount := Current._MergedLineCount;

View File

@ -1954,9 +1954,6 @@ begin
end;
function TSynMarkupHighAllMatchList.Insert(AStartPoint, AEndPoint: TPoint): integer;
var
C: Integer;
S: TPoint;
begin
Result := IndexOf(AStartPoint);
Insert(Result, AStartPoint, AEndPoint);

View File

@ -400,8 +400,6 @@ begin
end;
procedure TSynGutterBase.SetColor(const Value: TColor);
var
i: Integer;
begin
if FColor.Background = Value then
exit;
@ -409,8 +407,6 @@ begin
end;
procedure TSynGutterBase.SetCurrentLineColor(AValue: TSynHighlighterAttributesModifier);
var
i: Integer;
begin
FCurrentLineColor.Assign(AValue);
end;

View File

@ -27,7 +27,7 @@ unit SynGutterCodeFolding;
interface
uses
SysUtils, Classes, StrUtils, Controls, Graphics, Menus, LCLIntf,
SysUtils, Classes, Controls, Graphics, Menus, LCLIntf,
SynGutterBase, SynEditMiscProcs, SynEditFoldedView, SynEditMouseCmds,
SynEditHighlighterFoldBase, SynEditMiscClasses, LazSynEditText, LCLType,
ImgList, Forms;

View File

@ -27,7 +27,7 @@ interface
uses
Classes, Controls, SysUtils, Forms, Graphics, SynEditMiscClasses, LCLType,
SynEdit, SynPluginSyncronizedEditBase, LazSynEditText, SynEditMiscProcs,
SynEdit, SynPluginSyncronizedEditBase, SynEditMiscProcs,
SynEditMouseCmds, SynEditKeyCmds, SynEditTypes, SynEditHighlighter, LCLIntf,
LazUTF8, LazLoggerBase;
@ -412,8 +412,6 @@ end;
function TSynPluginSyncroEditWordsHash.CompareEntry(const aEntry1,
aEntry2: TSynPluginSyncroEditWordsHashEntry): Boolean;
var
Line1, Line2: String;
begin
Result := (aEntry1.Word = aEntry2.Word);
end;
@ -1057,11 +1055,10 @@ end;
procedure TSynPluginSyncroEdit.StartSyncroMode(AScanMode: TSynPluginSyncroScanMode);
var
Pos, EndPos: TPoint;
Line, tk, wrd: String;
x2, g, tt, tx, i: Integer;
Line, wrd: String;
x2, g: Integer;
entry: PSynPluginSyncroEditWordsHashEntry;
f, HasMultiCell: Boolean;
ta: TSynHighlighterAttributes;
f: Boolean;
m: TSynPluginSyncroScanMode;
begin
if FCallQueued then begin