View Issue Details

IDProjectCategoryView StatusLast Update
0037267LazarusIDEpublic2020-06-27 16:22
ReporterMaarten Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
Status newResolutionopen 
Product Version2.0.9 (SVN) 
Summary0037267: "Sort Selection" function in GUI sorts on first characters of line- including Function and Procedure
DescriptionWhen sorting a large declaration block, I want to be able to sort functions and procedures on their name- but the sort selection functionality does not allow to 'Ignore' "function" and "procedure" in the sorting order.
Steps To ReproduceSelect declaration block,
in the menu go to Edit ->Sort Selection
Choose options, sort.
Now all functions are grouped and all Procedures are grouped below that.
Additional InformationAdded the option to ignore the words "function" and "procedure" if they are the first word on a line
If this option is selected, sorting will occur on the name of function/procedure.

Patch attached.
TagsNo tags attached.
Fixed in Revision
LazTarget
Widgetset
Attached Files

Activities

Maarten

2020-06-26 13:34

reporter  

ide_sortOnFunctionName.patch (19,767 bytes)   
Index: lazarusidestrconsts.pas
===================================================================
--- lazarusidestrconsts.pas	(revision 63429)
+++ lazarusidestrconsts.pas	(working copy)
@@ -3872,6 +3872,8 @@
   lisSortSelCaseSensitive = '&Case Sensitive';
   lisSortSelIgnoreSpace = 'Ignore Space';
   lisSortSelSort = 'Accept';
+  lisSortSelIgnoreWords ='Ignore';
+  lisSortSelIgnoreWordsOption ='Ignore Function & Procedure (but sort on name)';
 
   // Publish project/package + Add dir to package
   lisDestinationDirectory = 'Destination directory';
Index: sortselectiondlg.lfm
===================================================================
--- sortselectiondlg.lfm	(revision 63429)
+++ sortselectiondlg.lfm	(working copy)
@@ -1,16 +1,17 @@
 object SortSelectionDialog: TSortSelectionDialog
   Left = 217
-  Height = 378
+  Height = 567
   Top = 141
-  Width = 493
+  Width = 740
   BorderIcons = [biSystemMenu]
   Caption = 'SortSelectionDialog'
-  ClientHeight = 378
-  ClientWidth = 493
+  ClientHeight = 567
+  ClientWidth = 740
+  DesignTimePPI = 144
   OnClose = FormClose
   OnCreate = FormCreate
   Position = poScreenCenter
-  LCLVersion = '1.1'
+  LCLVersion = '2.0.8.0'
   object PreviewGroupBox: TGroupBox
     AnchorSideLeft.Control = Owner
     AnchorSideTop.Control = Owner
@@ -17,15 +18,16 @@
     AnchorSideRight.Control = Owner
     AnchorSideRight.Side = asrBottom
     AnchorSideBottom.Control = DirectionRadioGroup
-    Left = 6
-    Height = 218
-    Top = 6
-    Width = 481
+    Left = 9
+    Height = 289
+    Top = 9
+    Width = 722
     Anchors = [akTop, akLeft, akRight, akBottom]
-    BorderSpacing.Around = 6
+    BorderSpacing.Around = 9
     Caption = 'PreviewGroupBox'
-    ClientHeight = 202
-    ClientWidth = 477
+    ClientHeight = 259
+    ClientWidth = 718
+    ParentFont = False
     TabOrder = 4
     inline PreviewSynEdit: TSynEdit
       AnchorSideLeft.Control = PreviewGroupBox
@@ -34,13 +36,13 @@
       AnchorSideRight.Side = asrBottom
       AnchorSideBottom.Control = PreviewGroupBox
       AnchorSideBottom.Side = asrBottom
-      Left = 6
-      Height = 190
-      Top = 6
-      Width = 465
-      BorderSpacing.Around = 6
+      Left = 9
+      Height = 241
+      Top = 9
+      Width = 700
+      BorderSpacing.Around = 9
       Anchors = [akTop, akLeft, akRight, akBottom]
-      Font.Height = -13
+      Font.Height = -20
       Font.Name = 'Courier New'
       Font.Pitch = fpFixed
       Font.Quality = fqNonAntialiased
@@ -48,7 +50,7 @@
       ParentFont = False
       TabOrder = 0
       TabStop = False
-      Gutter.Width = 57
+      Gutter.Width = 85
       Gutter.MouseActions = <>
       RightGutter.Width = 0
       RightGutter.MouseActions = <>
@@ -474,6 +476,7 @@
           ShortCut = 57379
         end>
       MouseActions = <>
+      MouseTextActions = <>
       MouseSelActions = <>
       Lines.Strings = (
         ''
@@ -480,6 +483,13 @@
       )
       VisibleSpecialChars = [vscSpace, vscTabAtLast]
       ReadOnly = True
+      SelectedColor.BackPriority = 50
+      SelectedColor.ForePriority = 50
+      SelectedColor.FramePriority = 50
+      SelectedColor.BoldPriority = 50
+      SelectedColor.ItalicPriority = 50
+      SelectedColor.UnderlinePriority = 50
+      SelectedColor.StrikeOutPriority = 50
       BracketHighlightStyle = sbhsBoth
       BracketMatchColor.Background = clNone
       BracketMatchColor.Foreground = clNone
@@ -493,11 +503,11 @@
       LineHighlightColor.Foreground = clNone
       inline SynLeftGutterPartList1: TSynGutterPartList
         object SynGutterMarks1: TSynGutterMarks
-          Width = 24
+          Width = 36
           MouseActions = <>
         end
         object SynGutterLineNumber1: TSynGutterLineNumber
-          Width = 17
+          Width = 25
           MouseActions = <>
           MarkupInfo.Background = clBtnFace
           MarkupInfo.Foreground = clNone
@@ -507,16 +517,19 @@
           LeadingZeros = False
         end
         object SynGutterChanges1: TSynGutterChanges
-          Width = 4
+          Width = 6
           MouseActions = <>
           ModifiedColor = 59900
           SavedColor = clGreen
         end
         object SynGutterSeparator1: TSynGutterSeparator
-          Width = 2
+          Width = 3
           MouseActions = <>
+          MarkupInfo.Background = clWhite
+          MarkupInfo.Foreground = clGray
         end
         object SynGutterCodeFolding1: TSynGutterCodeFolding
+          Width = 15
           MouseActions = <>
           MarkupInfo.Background = clNone
           MarkupInfo.Foreground = clGray
@@ -531,27 +544,29 @@
     AnchorSideRight.Control = Owner
     AnchorSideRight.Side = asrBottom
     AnchorSideBottom.Control = DomainRadioGroup
-    Left = 6
-    Height = 30
-    Top = 230
-    Width = 481
+    Left = 9
+    Height = 45
+    Top = 307
+    Width = 722
     Anchors = [akLeft, akRight, akBottom]
     AutoFill = True
     AutoSize = True
-    BorderSpacing.Around = 6
+    BorderSpacing.Around = 9
     Caption = 'DirectionRadioGroup'
     ChildSizing.LeftRightSpacing = 6
     ChildSizing.TopBottomSpacing = 6
     ChildSizing.HorizontalSpacing = 10
+    ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
     ChildSizing.EnlargeVertical = crsHomogenousChildResize
     ChildSizing.ShrinkHorizontal = crsScaleChilds
     ChildSizing.ShrinkVertical = crsScaleChilds
     ChildSizing.Layout = cclTopToBottomThenLeftToRight
-    ChildSizing.ControlsPerLine = 5
+    ChildSizing.ControlsPerLine = 1
     ColumnLayout = clVerticalThenHorizontal
     Columns = 2
-    Constraints.MinHeight = 30
+    Constraints.MinHeight = 45
     OnClick = DirectionRadioGroupClick
+    ParentFont = False
     TabOrder = 1
   end
   object DomainRadioGroup: TRadioGroup
@@ -559,26 +574,28 @@
     AnchorSideRight.Control = Owner
     AnchorSideRight.Side = asrBottom
     AnchorSideBottom.Control = OptionsCheckGroup
-    Left = 6
-    Height = 30
-    Top = 266
-    Width = 481
+    Left = 9
+    Height = 45
+    Top = 361
+    Width = 722
     Anchors = [akLeft, akRight, akBottom]
     AutoFill = True
     AutoSize = True
-    BorderSpacing.Around = 6
+    BorderSpacing.Around = 9
     Caption = 'DomainRadioGroup'
     ChildSizing.LeftRightSpacing = 6
     ChildSizing.TopBottomSpacing = 6
     ChildSizing.HorizontalSpacing = 10
+    ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
     ChildSizing.EnlargeVertical = crsHomogenousChildResize
     ChildSizing.ShrinkHorizontal = crsScaleChilds
     ChildSizing.ShrinkVertical = crsScaleChilds
     ChildSizing.Layout = cclLeftToRightThenTopToBottom
-    ChildSizing.ControlsPerLine = 5
+    ChildSizing.ControlsPerLine = 3
     Columns = 3
-    Constraints.MinHeight = 30
+    Constraints.MinHeight = 45
     OnClick = DomainRadioGroupClick
+    ParentFont = False
     TabOrder = 2
   end
   object OptionsCheckGroup: TCheckGroup
@@ -585,34 +602,37 @@
     AnchorSideLeft.Control = Owner
     AnchorSideRight.Control = Owner
     AnchorSideRight.Side = asrBottom
-    AnchorSideBottom.Control = ButtonPanel
-    Left = 6
-    Height = 30
-    Top = 302
-    Width = 481
+    AnchorSideBottom.Control = IgnoreWordsCheckGroup
+    Left = 9
+    Height = 45
+    Top = 415
+    Width = 722
     Anchors = [akLeft, akRight, akBottom]
     AutoFill = True
     AutoSize = True
-    BorderSpacing.Around = 6
+    BorderSpacing.Around = 9
     Caption = 'OptionsCheckGroup'
     ChildSizing.LeftRightSpacing = 6
     ChildSizing.TopBottomSpacing = 6
     ChildSizing.HorizontalSpacing = 10
+    ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
     ChildSizing.EnlargeVertical = crsHomogenousChildResize
     ChildSizing.ShrinkHorizontal = crsScaleChilds
     ChildSizing.ShrinkVertical = crsScaleChilds
     ChildSizing.Layout = cclLeftToRightThenTopToBottom
-    ChildSizing.ControlsPerLine = 5
+    ChildSizing.ControlsPerLine = 2
     Columns = 2
-    Constraints.MinHeight = 30
+    Constraints.MinHeight = 45
     OnItemClick = OptionsCheckGroupItemClick
+    ParentFont = False
     TabOrder = 3
   end
   object ButtonPanel: TButtonPanel
-    Left = 6
-    Height = 34
-    Top = 338
-    Width = 481
+    Left = 9
+    Height = 35
+    Top = 523
+    Width = 722
+    BorderSpacing.Around = 9
     OKButton.Name = 'OKButton'
     OKButton.DefaultCaption = True
     HelpButton.Name = 'HelpButton'
@@ -625,4 +645,28 @@
     ShowButtons = [pbOK, pbCancel]
     ShowBevel = False
   end
+  object IgnoreWordsCheckGroup: TCheckGroup
+    AnchorSideLeft.Control = Owner
+    AnchorSideRight.Control = Owner
+    AnchorSideRight.Side = asrBottom
+    AnchorSideBottom.Control = ButtonPanel
+    Left = 9
+    Height = 45
+    Top = 469
+    Width = 722
+    Anchors = [akLeft, akRight, akBottom]
+    AutoFill = True
+    BorderSpacing.Around = 9
+    Caption = 'IgnoreWordsCheckGroup'
+    ChildSizing.LeftRightSpacing = 6
+    ChildSizing.TopBottomSpacing = 6
+    ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
+    ChildSizing.EnlargeVertical = crsHomogenousChildResize
+    ChildSizing.ShrinkHorizontal = crsScaleChilds
+    ChildSizing.ShrinkVertical = crsScaleChilds
+    ChildSizing.Layout = cclLeftToRightThenTopToBottom
+    ChildSizing.ControlsPerLine = 1
+    OnItemClick = IgnoreWordsCheckGroupItemClick
+    TabOrder = 5
+  end
 end
Index: sortselectiondlg.pas
===================================================================
--- sortselectiondlg.pas	(revision 63429)
+++ sortselectiondlg.pas	(working copy)
@@ -34,6 +34,7 @@
 }
 unit SortSelectionDlg;
 
+
 {$mode objfpc}{$H+}
 
 interface
@@ -50,8 +51,9 @@
   TextTools, IDEWindowIntf,
   // IDE
   LazarusIDEStrConsts, EditorOptions, MiscOptions, SourceMarks;
-  
+  const   IgnoredWords:array[0..1] of string=('procedure','function');
 type
+
   TSortSelDlgState = (
     ssdPreviewNeedsUpdate,
     ssdSortedTextNeedsUpdate
@@ -62,6 +64,7 @@
 
   TSortSelectionDialog = class(TForm)
     ButtonPanel: TButtonPanel;
+    IgnoreWordsCheckGroup: TCheckGroup;
     OptionsCheckGroup: TCheckGroup;
     PreviewGroupBox: TGroupBox;
     PreviewSynEdit: TSynEdit;
@@ -71,6 +74,7 @@
     procedure DomainRadioGroupClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
     procedure FormCreate(Sender: TObject);
+    procedure IgnoreWordsCheckGroupItemClick(Sender: TObject; Index: integer);
     procedure OptionsCheckGroupItemClick(Sender: TObject; Index: integer);
   private
     FCaseSensitive: boolean;
@@ -77,14 +81,17 @@
     FDirection: TSortDirection;
     FDomain: TSortDomain;
     FIgnoreSpace: boolean;
+    //FIgnoreProcFunc: Boolean;
     FStates: TSortSelDlgStates;
     FTheText: string;
     FUpdateCount: integer;
     FSortedText: string;
+    function GetIgnoreProcFunc: boolean;
     function GetSortedText: string;
     procedure SetCaseSensitive(const AValue: boolean);
     procedure SetDirection(const AValue: TSortDirection);
     procedure SetDomain(const AValue: TSortDomain);
+    procedure SetIgnoreProcFunc(AValue: boolean);
     procedure SetIgnoreSpace(const AValue: boolean);
     procedure SetTheText(const AValue: string);
   public
@@ -96,6 +103,7 @@
     property Direction: TSortDirection read FDirection write SetDirection;
     property Domain: TSortDomain read FDomain write SetDomain;
     property IgnoreSpace: boolean read FIgnoreSpace write SetIgnoreSpace;
+    property IgnoreProcFunc:  boolean read GetIgnoreProcFunc write SetIgnoreProcFunc;
     property TheText: string read FTheText write SetTheText;
     property SortedText: string read GetSortedText;
   end;
@@ -104,12 +112,21 @@
   Highlighter: TSynCustomHighlighter;
   out SortedText: string): TModalResult;
 function SortText(const TheText: string; Direction: TSortDirection;
-  Domain: TSortDomain; CaseSensitive, IgnoreSpace: boolean): string;
+  Domain: TSortDomain; CaseSensitive, IgnoreSpace: Boolean): string;
 
 implementation
 
 {$R *.lfm}
-
+Type
+    TTextBlockCompareSettings = class
+  public
+    CaseSensitive: boolean;
+    IgnoreSpace: boolean;
+    Ascending: boolean;
+    IgnoreProcFunc: Boolean;
+  end;
+var
+  Settings: TTextBlockCompareSettings;
 function ShowSortSelectionDialog(const TheText: string;
   Highlighter: TSynCustomHighlighter; out SortedText: string): TModalResult;
 var
@@ -142,58 +159,112 @@
 end;
 
 type
-  TTextBlockCompareSettings = class
-  public
-    CaseSensitive: boolean;
-    IgnoreSpace: boolean;
-    Ascending: boolean;
-  end;
 
+
+  { TTextBlock }
+
   TTextBlock = class
   public
-    Settings: TTextBlockCompareSettings;
+    //Settings: TTextBlockCompareSettings;
     Start: PChar;
     Len: integer;
-    constructor Create(TheSettings: TTextBlockCompareSettings;
+    constructor Create(//TheSettings: TTextBlockCompareSettings;
       NewStart: PChar; NewLen: integer);
+    Function RemoveIngnoredWord(TestWord: String): Boolean;
+    Function SortString: String;
+    function ToString : String;
   end;
 
 { TTextBlock }
 
-constructor TTextBlock.Create(TheSettings: TTextBlockCompareSettings;
+constructor TTextBlock.Create(//TheSettings: TTextBlockCompareSettings;
   NewStart: PChar; NewLen: integer);
 begin
-  Settings:=TheSettings;
+  //Settings:=TheSettings;
   Start:=NewStart;
   Len:=NewLen;
 end;
-  
+function TTextBlock.ToString: String;
+begin
+   Result:= Start;
+   SetLength(result,self.Len);
+end;
+
+function TTextBlock.SortString: String;
+var
+  I,J: Integer;
+  LoopChar: Char;
+  TestStr: String;
+begin
+  TestStr:='';
+  I:=1;
+  J:=1;
+  Result:=self.ToString;
+  for LoopChar in Result do
+  begin
+    if (TestStr='') and (LoopChar=' ') then
+    begin
+      inc(I);
+      continue;
+    end
+    else if (LoopChar=' ') and RemoveIngnoredWord(TestStr) then
+    begin  //we start with an excluded word, get the rest
+        Delete(Result, I, J);
+        Exit;
+    end
+    else  if (LoopChar=' ')  then
+       exit//first wird was not excluded;
+    else
+    begin
+       teststr:=TestStr + LoopChar; //not yet the end of the first word
+       inc(J);
+    end;
+  end;
+end;
+
+function TTextBlock.RemoveIngnoredWord(TestWord: String): Boolean;
+var LoopWord: String;
+begin
+  Result:=False;
+  for LoopWord in IgnoredWords do
+  begin
+    if LowerCase(LoopWord)=LowerCase(TestWord) then exit(true);
+  end;
+end;
+{end ttextblock}
 function CompareTextBlock(Data1, Data2: Pointer): integer;
 var
   Block1: TTextBlock;
   Block2: TTextBlock;
-  Settings: TTextBlockCompareSettings;
+  //Settings: TTextBlockCompareSettings;
+  SS1,SS2: String;
 begin
   Block1:=TTextBlock(Data1);
   Block2:=TTextBlock(Data2);
-  Settings:=Block1.Settings;
-  Result:=CompareText(Block1.Start,Block1.Len,Block2.Start,Block2.Len,
-                      Settings.CaseSensitive,Settings.IgnoreSpace);
+  //Settings:=Block1.Settings;
+  if Settings.IgnoreProcFunc then
+  begin
+     SS1:=Block1.SortString;
+     SS2:=Block2.SortString;
+     Result:=CompareText(pchar(SS1), length(SS1),pchar(SS2),Length(SS2),Settings.CaseSensitive,Settings.IgnoreSpace);
+  end else
+     Result:=CompareText(Block1.Start,Block1.Len,Block2.Start,Block2.Len, Settings.CaseSensitive,Settings.IgnoreSpace);
+
+
   if not Settings.Ascending then
     Result:=-Result;
 end;
 
 function SortText(const TheText: string; Direction: TSortDirection;
-  Domain: TSortDomain; CaseSensitive, IgnoreSpace: boolean): string;
+  Domain: TSortDomain; CaseSensitive, IgnoreSpace: Boolean): string;
 const
   IdentChars = ['_','a'..'z','A'..'Z'];
   SpaceChars = [' ',#9];
 var
-  Settings: TTextBlockCompareSettings;
   Tree: TAVLTree;// tree of TTextBlock
   StartPos: Integer;
   EndPos: Integer;
-  ANode: TAVLTreeNode;
+  ANode: TAVLTreeNode;//TAVLTreeNode;
   ABlock: TTextBlock;
   TxtLen: integer;
   LastNode: TAVLTreeNode;
@@ -203,17 +274,18 @@
   HeaderIndent: Integer;
   CurIndent: Integer;
   CurPos: Integer;
+
 begin
   Result:=TheText;
   if Result='' then exit;
   // create compare settings
-  Settings:=TTextBlockCompareSettings.Create;
+  //Settings:=TTextBlockCompareSettings.Create;
   Settings.CaseSensitive:=CaseSensitive;
   Settings.IgnoreSpace:=IgnoreSpace;
   Settings.Ascending:=(Direction=sdAscending);
+  //Settings.IgnoreProcFunc:=IgnoreProcFunc;
   // create AVL tree
   Tree:=TAVLTree.Create(@CompareTextBlock);
-  
   // collect text blocks
   TxtLen:=length(TheText);
   case Domain of
@@ -242,7 +314,8 @@
         // new block
         if EndPos>StartPos then
           Tree.Add(
-            TTextBlock.Create(Settings,@TheText[StartPos],EndPos-StartPos));
+            TTextBlock.Create(//Settings,
+            @TheText[StartPos],EndPos-StartPos));
         StartPos:=EndPos;
       end;
       EndPos:=CurPos;
@@ -259,7 +332,8 @@
       end;
     end;
     if EndPos>StartPos then
-      Tree.Add(TTextBlock.Create(Settings,@TheText[StartPos],EndPos-StartPos));
+      Tree.Add(TTextBlock.Create(//Settings,
+      @TheText[StartPos],EndPos-StartPos));
   end;
   
   sdWords, sdLines:
@@ -286,13 +360,14 @@
               inc(EndPos);
             break;
           end;
-
         end;
         inc(EndPos);
       end;
       if EndPos>TxtLen then EndPos:=TxtLen+1;
       if EndPos>StartPos then
-        Tree.Add(TTextBlock.Create(Settings,@TheText[StartPos],EndPos-StartPos));
+        Tree.Add( TTextBlock.Create(//Settings,
+        @TheText[StartPos],EndPos-StartPos));
+
       StartPos:=EndPos;
     end;
   end;
@@ -330,9 +405,10 @@
   end;
   
   // clean up
+  //FreeNodeData(Tree.Root as MyTreeNode);
   Tree.FreeAndClear;
   Tree.Free;
-  Settings.Free;
+  //Settings.Free;
 end;
 
 { TSortSelectionDialog }
@@ -368,6 +444,7 @@
 begin
   FCaseSensitive:=false;
   FIgnoreSpace:=true;
+  IgnoreProcFunc:=true;
   FDirection:=MiscellaneousOptions.SortSelDirection;
   FDomain:=MiscellaneousOptions.SortSelDomain;
   FStates:=FStates+[ssdPreviewNeedsUpdate,ssdSortedTextNeedsUpdate];
@@ -422,9 +499,29 @@
     end;
   end;
 
+   with IgnoreWordsCheckGroup do begin
+   Caption:=lisSortSelIgnoreWords;
+   ChildSizing.EnlargeHorizontal:=crsAnchorAligning;
+   with Items do begin
+      BeginUpdate;
+      Add(lisSortSelIgnoreWordsOption);
+      EndUpdate;
+      Checked[0]:=IgnoreProcFunc;
+      Settings.IgnoreProcFunc:=IgnoreProcFunc;
+   end;
+end;
+
   ButtonPanel.OKButton.Caption:=lisSortSelSort;
 end;
 
+procedure TSortSelectionDialog.IgnoreWordsCheckGroupItemClick(Sender: TObject;
+   Index: integer);
+begin
+   case Index of
+     0:  IgnoreProcFunc:=IgnoreWordsCheckGroup.Checked[0];
+   end;
+end;
+
 procedure TSortSelectionDialog.OptionsCheckGroupItemClick(Sender: TObject;
   Index: integer);
 begin
@@ -451,6 +548,11 @@
   Result:=FSortedText;
 end;
 
+function TSortSelectionDialog.GetIgnoreProcFunc: boolean;
+begin
+   Result:=Settings.IgnoreProcFunc;
+end;
+
 procedure TSortSelectionDialog.SetCaseSensitive(const AValue: boolean);
 begin
   if FCaseSensitive=AValue then exit;
@@ -469,6 +571,16 @@
   UpdatePreview;
 end;
 
+procedure TSortSelectionDialog.SetIgnoreProcFunc(AValue: boolean);
+begin
+   if Settings.IgnoreProcFunc=AValue then Exit;
+   Settings.IgnoreProcFunc:=AValue;
+   FStates:=FStates+[ssdPreviewNeedsUpdate,ssdSortedTextNeedsUpdate];
+  if (IgnoreWordsCheckGroup<>nil) AND (IgnoreWordsCheckGroup.Items.Count>0)then
+    IgnoreWordsCheckGroup.Checked[0]:=IgnoreProcFunc;
+  UpdatePreview;
+end;
+
 procedure TSortSelectionDialog.SetIgnoreSpace(const AValue: boolean);
 begin
   if FIgnoreSpace=AValue then exit;
@@ -515,6 +627,10 @@
 initialization
   TextTools.ShowSortSelectionDialogFunc:=@ShowSortSelectionDialogBase;
   TextTools.SortTextFunc:=@SortText;
+  Settings:=TTextBlockCompareSettings.Create;
 
+Finalization
+   Settings.Free;
+
 end.
 
ide_sortOnFunctionName.patch (19,767 bytes)   

Martin Friebe

2020-06-27 16:21

manager   ~0123625

Last edited: 2020-06-27 16:22

View 2 revisions

What about (with varying spacing):
class procedure Xyz;
class function Xyz;

constructor Foo;
destructor Foo;
class constructor Foo;
class destructor Foo;

Maybe
property Xyz...;

Some of those may want to be kept together of course. I am not sure which should be grouped with which.
But then if the selection has fields and procedures, should the fields be kept from mixing with the procedures?


And should there be a domain, to keep wrapped declarations together?

Issue History

Date Modified Username Field Change
2020-06-26 13:34 Maarten New Issue
2020-06-26 13:34 Maarten File Added: ide_sortOnFunctionName.patch
2020-06-27 16:21 Martin Friebe Note Added: 0123625
2020-06-27 16:22 Martin Friebe Note Edited: 0123625 View Revisions