Browse Source

* adapted to modified tokens unit
* TryToOpen works better

pierre 26 years ago
parent
commit
cc6269dc3b
1 changed files with 21 additions and 10 deletions
  1. 21 10
      ide/text/fpviews.pas

+ 21 - 10
ide/text/fpviews.pas

@@ -157,6 +157,9 @@ type
       function    GetPalette: PPalette;virtual;
       function    GetPalette: PPalette;virtual;
       constructor Load(var S: TStream);
       constructor Load(var S: TStream);
       procedure   Store(var S: TStream);                                                                                                                                                                                                                       
       procedure   Store(var S: TStream);                                                                                                                                                                                                                       
+
+
+
       destructor  Done; virtual;
       destructor  Done; virtual;
     end;
     end;
 
 
@@ -581,8 +584,8 @@ var
   Count,I: integer;
   Count,I: integer;
 begin
 begin
   Count:=0;
   Count:=0;
-  for I:=ord(Low(TokenInfo)) to ord(High(TokenInfo)) do
-   with TokenInfo[TToken(I)] do
+  for I:=ord(Low(tToken)) to ord(High(tToken)) do
+   with TokenInfo^[TToken(I)] do
      if (str<>'') and (str[1] in['A'..'Z']) then
      if (str<>'') and (str[1] in['A'..'Z']) then
        Inc(Count);
        Inc(Count);
   GetReservedWordCount:=Count;
   GetReservedWordCount:=Count;
@@ -595,9 +598,9 @@ var
 begin
 begin
   Idx:=-1;
   Idx:=-1;
   Count:=-1;
   Count:=-1;
-  I:=ord(Low(TokenInfo));
-  while (I<=ord(High(TokenInfo))) and (Idx=-1) do
-   with TokenInfo[TToken(I)] do
+  I:=ord(Low(tToken));
+  while (I<=ord(High(tToken))) and (Idx=-1) do
+   with TokenInfo^[TToken(I)] do
     begin
     begin
       if (str<>'') and (str[1] in['A'..'Z']) then
       if (str<>'') and (str[1] in['A'..'Z']) then
         begin
         begin
@@ -610,7 +613,7 @@ begin
   if Idx=-1 then
   if Idx=-1 then
     S:=''
     S:=''
   else
   else
-    S:=TokenInfo[TToken(Idx)].str;
+    S:=TokenInfo^[TToken(Idx)].str;
   GetReservedWord:=S;
   GetReservedWord:=S;
 end;
 end;
 
 
@@ -2354,7 +2357,10 @@ var D : DirStr;
   function SearchOnDesktop: PSourceWindow;
   function SearchOnDesktop: PSourceWindow;
   var W: PWindow;
   var W: PWindow;
       I: integer;
       I: integer;
-      Found: boolean;
+      DS : DirStr;
+      NS : NameStr;
+      ES : ExtStr;
+      Found : boolean; 
       SName : string;
       SName : string;
   begin
   begin
     for I:=1 to 100 do
     for I:=1 to 100 do
@@ -2366,12 +2372,13 @@ var D : DirStr;
             SName:=NameAndExtOf(PSourceWindow(W)^.Editor^.FileName)
             SName:=NameAndExtOf(PSourceWindow(W)^.Editor^.FileName)
           else
           else
             SName:=PSourceWindow(W)^.Editor^.FileName;
             SName:=PSourceWindow(W)^.Editor^.FileName;
-          SName:=UpcaseStr(SName);
+          FSplit(SName,DS,NS,ES);
+          SName:=UpcaseStr(NS+ES);
 
 
           if (E<>'') or (not tryexts) then
           if (E<>'') or (not tryexts) then
             begin
             begin
               if D<>'' then
               if D<>'' then
-                Found:=SName=UpcaseStr(D+N+E)
+                Found:=UpCaseStr(DS)+SName=UpcaseStr(D+N+E)
               else
               else
                 Found:=SName=UpcaseStr(N+E);
                 Found:=SName=UpcaseStr(N+E);
             end
             end
@@ -2739,7 +2746,11 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.38  1999-08-31 16:18:33  pierre
+  Revision 1.39  1999-09-03 12:54:07  pierre
+    * adapted to modified tokens unit
+    * TryToOpen works better
+
+  Revision 1.38  1999/08/31 16:18:33  pierre
    + TGDBWindow.Load and Store + Registration
    + TGDBWindow.Load and Store + Registration
 
 
   Revision 1.37  1999/08/16 18:25:26  peter
   Revision 1.37  1999/08/16 18:25:26  peter