Browse Source

+ HistList for Grep

pierre 26 years ago
parent
commit
70c7ea7dbb
1 changed files with 15 additions and 6 deletions
  1. 15 6
      ide/text/fpmtools.inc

+ 15 - 6
ide/text/fpmtools.inc

@@ -143,7 +143,8 @@ Const
   GrepExeName = 'grep'+ExeExt;
   GrepExeName = 'grep'+ExeExt;
 var
 var
   PGrepDialog : PCenterDialog;
   PGrepDialog : PCenterDialog;
-  R,R2 : TRect;
+  R,R1,R2 : TRect;
+  Control : PView;
   IL1,IL2 : PInputLine;
   IL1,IL2 : PInputLine;
   s : string;
   s : string;
   p,lineNb : longint;
   p,lineNb : longint;
@@ -175,21 +176,26 @@ begin
   ReplaceStr(s,';',' ');
   ReplaceStr(s,';',' ');
   { add "" for args with spaces }
   { add "" for args with spaces }
   { WARNING : text must still be entered in usual grep syntax }
   { WARNING : text must still be entered in usual grep syntax }
-  GrepArgs:='-n -i "$TEXT" '+s;
+  { -n is always added later because otherwise
+    we don't get the line info PM }
+  GrepArgs:=' -i "$TEXT" '+s;
 { Dialog }
 { Dialog }
-  R.Assign(0,0,45,8);
+  R.Assign(0,0,50,8);
   new(PGrepDialog,Init(R,'Grep arguments'));
   new(PGrepDialog,Init(R,'Grep arguments'));
   with PGrepDialog^ do
   with PGrepDialog^ do
     begin
     begin
       R2.A.Y:=R.A.Y+3;
       R2.A.Y:=R.A.Y+3;
       R2.B.Y:=R2.A.Y+1;
       R2.B.Y:=R2.A.Y+1;
       R2.A.X:=R.A.X+3;
       R2.A.X:=R.A.X+3;
-      R2.B.X:=R.B.X-3;
+      R2.B.X:=R.B.X-6;
       New(IL1, Init(R2, 128));
       New(IL1, Init(R2, 128));
       IL1^.Data^:=SearchWord;
       IL1^.Data^:=SearchWord;
       Insert(IL1);
       Insert(IL1);
       R2.Move(0,-1);
       R2.Move(0,-1);
       Insert(New(PLabel, Init(R2, '~T~ext to find', IL1)));
       Insert(New(PLabel, Init(R2, '~T~ext to find', IL1)));
+      R1.Assign(R2.B.X, R2.A.Y+1, R2.B.X+3, R2.B.Y+1);
+      Control := New(PHistory, Init(R1, IL1, TextGrepId));
+      Insert(Control);
 
 
       R2.Move(0,4);
       R2.Move(0,4);
       New(IL2, Init(R2, 128));
       New(IL2, Init(R2, 128));
@@ -210,7 +216,7 @@ begin
          GrepArgs:=IL2^.Data^;
          GrepArgs:=IL2^.Data^;
          ReplaceStr(GrepArgs,'$TEXT',SearchWord);
          ReplaceStr(GrepArgs,'$TEXT',SearchWord);
          { Linux ? }
          { Linux ? }
-         AddToolCommand(GrepExe+' '+GrepArgs);
+         AddToolCommand(GrepExe+' -n '+GrepArgs);
          ToFocus:=ToolMessages^.count-1;
          ToFocus:=ToolMessages^.count-1;
          if not ExecuteRedir(GrepExe,GrepArgs,'',GrepOutName,GrepErrName) then
          if not ExecuteRedir(GrepExe,GrepArgs,'',GrepOutName,GrepErrName) then
            Begin
            Begin
@@ -262,7 +268,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.13  1999-08-03 20:22:35  peter
+  Revision 1.14  1999-09-22 16:17:31  pierre
+   + HistList for Grep
+
+  Revision 1.13  1999/08/03 20:22:35  peter
     + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
     + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
     + Desktop saving should work now
     + Desktop saving should work now
        - History saved
        - History saved