From fb8fecd205999590966240dbab014c39347e376c Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 23 Feb 2025 12:27:52 +0100 Subject: [PATCH] SynEdit: cleanup, remove unused var --- components/synedit/synedit.pp | 7 +------ components/synedit/syneditfoldedview.pp | 4 +--- components/synedit/syneditmarkuphighall.pp | 3 --- components/synedit/syngutterbase.pp | 4 ---- components/synedit/synguttercodefolding.pp | 2 +- components/synedit/synpluginsyncroedit.pp | 11 ++++------- 6 files changed, 7 insertions(+), 24 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index eaeb619782..46a51d0fbd 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -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; diff --git a/components/synedit/syneditfoldedview.pp b/components/synedit/syneditfoldedview.pp index 1906965c76..56e7579a82 100644 --- a/components/synedit/syneditfoldedview.pp +++ b/components/synedit/syneditfoldedview.pp @@ -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; diff --git a/components/synedit/syneditmarkuphighall.pp b/components/synedit/syneditmarkuphighall.pp index bb12965c72..41bc297cb6 100644 --- a/components/synedit/syneditmarkuphighall.pp +++ b/components/synedit/syneditmarkuphighall.pp @@ -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); diff --git a/components/synedit/syngutterbase.pp b/components/synedit/syngutterbase.pp index d1c7906835..af0e017aae 100644 --- a/components/synedit/syngutterbase.pp +++ b/components/synedit/syngutterbase.pp @@ -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; diff --git a/components/synedit/synguttercodefolding.pp b/components/synedit/synguttercodefolding.pp index fb698a5091..b047d9b931 100644 --- a/components/synedit/synguttercodefolding.pp +++ b/components/synedit/synguttercodefolding.pp @@ -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; diff --git a/components/synedit/synpluginsyncroedit.pp b/components/synedit/synpluginsyncroedit.pp index 6723f5b510..45295bb66f 100644 --- a/components/synedit/synpluginsyncroedit.pp +++ b/components/synedit/synpluginsyncroedit.pp @@ -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