Browse Source

+ TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+ Desktop saving should work now
- History saved
- Clipboard content saved
- Desktop saved
- Symbol info saved
* syntax-highlight bug fixed, which compared special keywords case sensitive
(for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
* with 'whole words only' set, the editor didn't found occourences of the
searched text, if the text appeared previously in the same line, but didn't
satisfied the 'whole-word' condition
* ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
(ie. the beginning of the selection)
* when started typing in a new line, but not at the start (X=0) of it,
the editor inserted the text one character more to left as it should...
* TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
* Shift shouldn't cause so much trouble in TCodeEditor now...
* Syntax highlight had problems recognizing a special symbol if it was
prefixed by another symbol character in the source text
* Auto-save also occours at Dos shell, Tool execution, etc. now...

peter 26 years ago
parent
commit
9f334f17ac

+ 36 - 15
ide/text/fp.pas

@@ -32,7 +32,8 @@ uses
   WViews,
   WViews,
   FPIDE,FPCalc,FPCompile,
   FPIDE,FPCalc,FPCompile,
   FPIni,FPViews,FPConst,FPVars,FPUtils,FPHelp,FPSwitch,FPUsrScr,
   FPIni,FPViews,FPConst,FPVars,FPUtils,FPHelp,FPSwitch,FPUsrScr,
-  FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPTemplt,FPCatch,FPRedir,FPDesk;
+  FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPTemplt,FPCatch,FPRedir,FPDesk,
+  FPSymbol;
 
 
 
 
 procedure ProcessParams(BeforeINI: boolean);
 procedure ProcessParams(BeforeINI: boolean);
@@ -81,16 +82,19 @@ end;
 Procedure MyStreamError(Var S: TStream); {$ifndef FPC}far;{$endif}
 Procedure MyStreamError(Var S: TStream); {$ifndef FPC}far;{$endif}
 var ErrS: string;
 var ErrS: string;
 begin
 begin
-  {$ifdef GABOR}{$ifdef TP}asm int 3;end;{$endif}{$endif}
   case S.Status of
   case S.Status of
     stGetError : ErrS:='Get of unregistered object type';
     stGetError : ErrS:='Get of unregistered object type';
     stPutError : ErrS:='Put of unregistered object type';
     stPutError : ErrS:='Put of unregistered object type';
   else ErrS:='';
   else ErrS:='';
   end;
   end;
-  if Assigned(Application) then
-    ErrorBox('Stream error: '+#13+ErrS,nil)
-  else
-    writeln('Error: ',ErrS);
+  if ErrS<>'' then
+  begin
+    {$ifdef GABOR}{$ifdef TP}asm int 3;end;{$endif}{$endif}
+    if Assigned(Application) then
+      ErrorBox('Stream error: '+#13+ErrS,nil)
+    else
+      writeln('Error: ',ErrS);
+  end;
 end;
 end;
 
 
 procedure RegisterIDEObjects;
 procedure RegisterIDEObjects;
@@ -111,6 +115,7 @@ begin
   RegisterFPViews;
   RegisterFPViews;
   RegisterMenus;
   RegisterMenus;
   RegisterStdDlg;
   RegisterStdDlg;
+  RegisterSymbols;
   RegisterObjects;
   RegisterObjects;
   RegisterValidate;
   RegisterValidate;
   RegisterViews;
   RegisterViews;
@@ -160,18 +165,12 @@ BEGIN
   ProcessParams(false);
   ProcessParams(false);
 
 
   repeat
   repeat
-  MyApp.Run;
+    MyApp.Run;
     if (AutoSaveOptions and asEditorFiles)=0 then CanExit:=true else
     if (AutoSaveOptions and asEditorFiles)=0 then CanExit:=true else
       CanExit:=MyApp.SaveAll;
       CanExit:=MyApp.SaveAll;
   until CanExit;
   until CanExit;
 
 
-  { must be written before done for open files }
-  if (AutoSaveOptions and asEnvironment)<>0 then
-    if WriteINIFile=false then
-      ErrorBox('Error saving configuration.',nil);
-  if (AutoSaveOptions and asDesktop)<>0 then
-    if SaveDesktop=false then
-      ErrorBox('Error saving desktop.',nil);
+  MyApp.AutoSave;
 
 
   DoneDesktopFile;
   DoneDesktopFile;
 
 
@@ -196,7 +195,29 @@ BEGIN
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.28  1999-07-10 01:24:11  pierre
+  Revision 1.29  1999-08-03 20:22:25  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.28  1999/07/10 01:24:11  pierre
    + First implementation of watches window
    + First implementation of watches window
 
 
   Revision 1.27  1999/06/29 22:43:12  peter
   Revision 1.27  1999/06/29 22:43:12  peter

+ 25 - 3
ide/text/fpcompil.pas

@@ -544,8 +544,8 @@ begin
 {$endif TP}
 {$endif TP}
 { Compile ! }
 { Compile ! }
 {$ifdef redircompiler}
 {$ifdef redircompiler}
-  ChangeRedirOut('fp$$$.out',false);
-  ChangeRedirError('fp$$$.err',false);
+  ChangeRedirOut(FPOutFileName,false);
+  ChangeRedirError(FPErrFileName,false);
 {$endif}
 {$endif}
 {$ifdef TEMPHEAP}
 {$ifdef TEMPHEAP}
   split_heap;
   split_heap;
@@ -613,7 +613,29 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.32  1999-07-12 13:14:13  pierre
+  Revision 1.33  1999-08-03 20:22:26  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.32  1999/07/12 13:14:13  pierre
     * LineEnd bug corrected, now goes end of text even if selected
     * LineEnd bug corrected, now goes end of text even if selected
     + Until Return for debugger
     + Until Return for debugger
     + Code for Quit inside GDB Window
     + Code for Quit inside GDB Window

+ 29 - 3
ide/text/fpconst.pas

@@ -32,8 +32,12 @@ const
      SwitchesName         = 'fp.cfg';
      SwitchesName         = 'fp.cfg';
      DesktopName          = 'fp.dsk';
      DesktopName          = 'fp.dsk';
 
 
-     ToolCaptureName      = '$$TOOL$$.OUT';
-     FilterCaptureName    = '$FILTER$.OUT';
+     ToolCaptureName      = '__TOOL__.OUT'; { all '$' signs replaces with '_'s }
+     FilterCaptureName    = '_FILTER_.OUT';
+     FPOutFileName        = 'FP___.OUT';
+     FPErrFileName        = 'FP___.ERR';
+     GDBOutFileName       = 'GDB___.OUT';
+     GDBOutPutFileName    = 'GDB___.txt';
 
 
      HelpFileExts         = '*.tph;*.htm*';
      HelpFileExts         = '*.tph;*.htm*';
 
 
@@ -337,7 +341,29 @@ implementation
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.22  1999-07-12 13:14:14  pierre
+  Revision 1.23  1999-08-03 20:22:27  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.22  1999/07/12 13:14:14  pierre
     * LineEnd bug corrected, now goes end of text even if selected
     * LineEnd bug corrected, now goes end of text even if selected
     + Until Return for debugger
     + Until Return for debugger
     + Code for Quit inside GDB Window
     + Code for Quit inside GDB Window

+ 24 - 2
ide/text/fpdebug.pas

@@ -1869,7 +1869,7 @@ end;
 procedure InitDebugger;
 procedure InitDebugger;
 begin
 begin
 {$ifdef DEBUG}
 {$ifdef DEBUG}
-  Assign(gdb_file,'gdb$$$.out');
+  Assign(gdb_file,GDBOutFileName);
   Rewrite(gdb_file);
   Rewrite(gdb_file);
   Use_gdb_file:=true;
   Use_gdb_file:=true;
 {$endif}
 {$endif}
@@ -1952,7 +1952,29 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.23  1999-07-28 23:11:17  peter
+  Revision 1.24  1999-08-03 20:22:28  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.23  1999/07/28 23:11:17  peter
     * fixes from gabor
     * fixes from gabor
 
 
   Revision 1.22  1999/07/12 13:14:15  pierre
   Revision 1.22  1999/07/12 13:14:15  pierre

+ 201 - 19
ide/text/fpdesk.pas

@@ -18,6 +18,9 @@ unit FPDesk;
 interface
 interface
 
 
 const
 const
+     DesktopVersion     = $0001; { <- if you change any Load&Store methods,
+                                      then you should change also this }
+
      ResDesktopFlags    = 'FLAGS';
      ResDesktopFlags    = 'FLAGS';
      ResHistory         = 'HISTORY';
      ResHistory         = 'HISTORY';
      ResClipboard       = 'CLIPBOARD';
      ResClipboard       = 'CLIPBOARD';
@@ -34,9 +37,9 @@ procedure DoneDesktopFile;
 implementation
 implementation
 
 
 uses Dos,
 uses Dos,
-     Objects,App,
-     WResource,
-     FPConst,FPVars,FPUtils;
+     Objects,Drivers,Views,App,HistList,BrowCol,
+     WResource,WViews,WEditor,
+     FPConst,FPVars,FPUtils,FPViews,FPCompile,FPTools,FPHelp;
 
 
 procedure InitDesktopFile;
 procedure InitDesktopFile;
 begin
 begin
@@ -50,15 +53,58 @@ procedure DoneDesktopFile;
 begin
 begin
 end;
 end;
 
 
+function ReadHistory(F: PResourceFile): boolean;
+var S: PMemoryStream;
+    OK: boolean;
+begin
+  PushStatus('Reading history...');
+  New(S, Init(32*1024,4096));
+  OK:=F^.ReadResourceEntryToStream(resHistory,langDefault,S^);
+  S^.Seek(0);
+  if OK then
+    LoadHistory(S^);
+  Dispose(S, Done);
+  PopStatus;
+  ReadHistory:=OK;
+end;
+
 function WriteHistory(F: PResourceFile): boolean;
 function WriteHistory(F: PResourceFile): boolean;
+var S: PMemoryStream;
 begin
 begin
+  PushStatus('Storing history...');
+
+  New(S, Init(10*1024,4096));
+  StoreHistory(S^);
+  S^.Seek(0);
+  F^.CreateResource(resHistory,rcBinary,0);
+  F^.AddResourceEntryFromStream(resHistory,langDefault,0,S^,S^.GetSize);
+  Dispose(S, Done);
+  PopStatus;
   WriteHistory:=true;
   WriteHistory:=true;
 end;
 end;
 
 
+(*function ReadClipboard(F: PResourceFile): boolean;
+begin
+  ReadClipboard:=true;
+end;
+
 function WriteClipboard(F: PResourceFile): boolean;
 function WriteClipboard(F: PResourceFile): boolean;
+var S: PMemoryStream;
 begin
 begin
+  if Assigned(Clipboard) then
+  begin
+    PushStatus('Storing clipboard content...');
+
+    New(S, Init(10*1024,4096));
+    Clipboard^.SaveToStream(S^);
+    S^.Seek(0);
+    F^.CreateResource(resClipboard,rcBinary,0);
+    F^.AddResourceEntryFromStream(resClipboard,langDefault,0,S^,S^.GetSize);
+    Dispose(S, Done);
+    PopStatus;
+  end;
   WriteClipboard:=true;
   WriteClipboard:=true;
-end;
+end;*)
 
 
 function WriteWatches(F: PResourceFile): boolean;
 function WriteWatches(F: PResourceFile): boolean;
 begin
 begin
@@ -70,18 +116,90 @@ begin
   WriteBreakPoints:=true;
   WriteBreakPoints:=true;
 end;
 end;
 
 
+function ReadOpenWindows(F: PResourceFile): boolean;
+var S: PMemoryStream;
+    TempDesk: PFPDesktop;
+    OK: boolean;
+    W: word;
+begin
+  PushStatus('Reading desktop contents...');
+  New(S, Init(32*1024,4096));
+  OK:=F^.ReadResourceEntryToStream(resDesktop,langDefault,S^);
+  S^.Seek(0);
+  if OK then
+  begin
+    S^.Read(W,SizeOf(W));
+    OK:=(W=DesktopVersion);
+    if OK=false then
+      ErrorBox('Invalid desktop version. Desktop layout lost.',nil);
+  end;
+  if OK then
+    begin
+      TempDesk:=PFPDesktop(S^.Get);
+      OK:=Assigned(TempDesk);
+      if OK then
+        begin
+          Dispose(Desktop, Done);
+          Desktop:=TempDesk;
+
+          with Desktop^ do
+          begin
+            GetSubViewPtr(S^,CompilerMessageWindow);
+            GetSubViewPtr(S^,CompilerStatusDialog);
+            GetSubViewPtr(S^,ClipboardWindow);
+            if Assigned(ClipboardWindow) then Clipboard:=ClipboardWindow^.Editor;
+            GetSubViewPtr(S^,CalcWindow);
+            GetSubViewPtr(S^,ProgramInfoWindow);
+            GetSubViewPtr(S^,GDBWindow);
+            GetSubViewPtr(S^,BreakpointsWindow);
+            GetSubViewPtr(S^,WatchesWindow);
+            GetSubViewPtr(S^,UserScreenWindow);
+            GetSubViewPtr(S^,ASCIIChart);
+            GetSubViewPtr(S^,MessagesWindow); LastToolMessageFocused:=nil;
+          end;
+
+          Application^.Insert(Desktop);
+          Desktop^.ReDraw;
+          Message(Application,evBroadcast,cmUpdate,nil);
+        end;
+      if OK=false then
+        ErrorBox('Error loading desktop',nil);
+    end;
+  Dispose(S, Done);
+  PopStatus;
+  ReadOpenWindows:=OK;
+end;
+
 function WriteOpenWindows(F: PResourceFile): boolean;
 function WriteOpenWindows(F: PResourceFile): boolean;
 var S: PMemoryStream;
 var S: PMemoryStream;
+    W: word;
 begin
 begin
-  WriteOpenWindows:=true;
-  {$ifndef DEV}Exit;{$endif}
+  PushStatus('Storing desktop contents...');
 
 
-  New(S, Init(1024*1024,4096));
-  Desktop^.Store(S^);
+  New(S, Init(30*1024,4096));
+  W:=DesktopVersion;
+  S^.Write(W,SizeOf(W));
+  S^.Put(Desktop);
+  with Desktop^ do
+  begin
+    PutSubViewPtr(S^,CompilerMessageWindow);
+    PutSubViewPtr(S^,CompilerStatusDialog);
+    PutSubViewPtr(S^,ClipboardWindow);
+    PutSubViewPtr(S^,CalcWindow);
+    PutSubViewPtr(S^,ProgramInfoWindow);
+    PutSubViewPtr(S^,GDBWindow);
+    PutSubViewPtr(S^,BreakpointsWindow);
+    PutSubViewPtr(S^,WatchesWindow);
+    PutSubViewPtr(S^,UserScreenWindow);
+    PutSubViewPtr(S^,ASCIIChart);
+    PutSubViewPtr(S^,MessagesWindow);
+  end;
   S^.Seek(0);
   S^.Seek(0);
   F^.CreateResource(resDesktop,rcBinary,0);
   F^.CreateResource(resDesktop,rcBinary,0);
   F^.AddResourceEntryFromStream(resDesktop,langDefault,0,S^,S^.GetSize);
   F^.AddResourceEntryFromStream(resDesktop,langDefault,0,S^,S^.GetSize);
   Dispose(S, Done);
   Dispose(S, Done);
+  PopStatus;
+  WriteOpenWindows:=true;
 end;
 end;
 
 
 function WriteFlags(F: PResourceFile): boolean;
 function WriteFlags(F: PResourceFile): boolean;
@@ -94,34 +212,78 @@ begin
     SizeOf(DesktopFileFlags));
     SizeOf(DesktopFileFlags));
 end;
 end;
 
 
+function ReadSymbols(F: PResourceFile): boolean;
+var S: PMemoryStream;
+    OK: boolean;
+begin
+  PushStatus('Reading symbol information...');
+  New(S, Init(32*1024,4096));
+  OK:=F^.ReadResourceEntryToStream(resSymbols,langDefault,S^);
+  S^.Seek(0);
+  if OK then
+    LoadBrowserCol(S);
+  Dispose(S, Done);
+  PopStatus;
+  ReadSymbols:=OK;
+end;
+
 function WriteSymbols(F: PResourceFile): boolean;
 function WriteSymbols(F: PResourceFile): boolean;
+var S: PMemoryStream;
+    OK: boolean;
 begin
 begin
-  WriteSymbols:=true;
+  OK:=Assigned(Modules);
+
+  if OK then
+  begin
+    PushStatus('Storing symbol information...');
+
+    New(S, Init(200*1024,4096));
+    StoreBrowserCol(S);
+    S^.Seek(0);
+    F^.CreateResource(resSymbols,rcBinary,0);
+    F^.AddResourceEntryFromStream(resSymbols,langDefault,0,S^,S^.GetSize);
+    Dispose(S, Done);
+    PopStatus;
+  end;
+  WriteSymbols:=OK;
 end;
 end;
 
 
 function LoadDesktop: boolean;
 function LoadDesktop: boolean;
 var OK: boolean;
 var OK: boolean;
     F: PResourceFile;
     F: PResourceFile;
 begin
 begin
-  LoadDesktop:=true;
-  {$ifndef DEV}Exit;{$endif}
+  PushStatus('Reading desktop file...');
   New(F, LoadFile(DesktopPath));
   New(F, LoadFile(DesktopPath));
-  OK:=true;
 
 
+  OK:=Assigned(F);
+
+  if OK then
+  begin
+    ReadHistory(F);
+    ReadOpenWindows(F);
+    ReadSymbols(F);
+  end;
+
+  PopStatus;
+  LoadDesktop:=true;
 end;
 end;
 
 
 function SaveDesktop: boolean;
 function SaveDesktop: boolean;
 var OK: boolean;
 var OK: boolean;
     F: PResourceFile;
     F: PResourceFile;
 begin
 begin
+  PushStatus('Writing desktop file...');
   New(F, CreateFile(DesktopPath));
   New(F, CreateFile(DesktopPath));
-  OK:=true;
-  if OK and ((DesktopFileFlags and dfHistoryLists)<>0) then
-    OK:=WriteHistory(F);
+
+  if Assigned(Clipboard) then
+    if (DesktopFileFlags and dfClipboardContent)<>0 then
+      Clipboard^.Flags:=Clipboard^.Flags or efStoreContent
+    else
+      Clipboard^.Flags:=Clipboard^.Flags and not efStoreContent;
+
+  OK:=Assigned(F);
   if OK and ((DesktopFileFlags and dfHistoryLists)<>0) then
   if OK and ((DesktopFileFlags and dfHistoryLists)<>0) then
     OK:=WriteHistory(F);
     OK:=WriteHistory(F);
-  if OK and ((DesktopFileFlags and dfClipboardContent)<>0) then
-    OK:=WriteClipboard(F);
   if OK and ((DesktopFileFlags and dfWatches)<>0) then
   if OK and ((DesktopFileFlags and dfWatches)<>0) then
     OK:=WriteWatches(F);
     OK:=WriteWatches(F);
   if OK and ((DesktopFileFlags and dfBreakpoints)<>0) then
   if OK and ((DesktopFileFlags and dfBreakpoints)<>0) then
@@ -131,14 +293,34 @@ begin
   if OK and ((DesktopFileFlags and dfSymbolInformation)<>0) then
   if OK and ((DesktopFileFlags and dfSymbolInformation)<>0) then
     OK:=WriteSymbols(F);
     OK:=WriteSymbols(F);
   Dispose(F, Done);
   Dispose(F, Done);
+  PopStatus;
   SaveDesktop:=OK;
   SaveDesktop:=OK;
 end;
 end;
 
 
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1999-07-28 23:11:18  peter
-    * fixes from gabor
+  Revision 1.7  1999-08-03 20:22:30  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
 
 
   Revision 1.5  1999/06/30 23:58:13  pierre
   Revision 1.5  1999/06/30 23:58:13  pierre
     + BreakpointsList Window implemented
     + BreakpointsList Window implemented

+ 36 - 2
ide/text/fphelp.pas

@@ -38,6 +38,7 @@ procedure Help(FileID, Context: THelpCtx; Modal: boolean);
 procedure HelpIndex(Keyword: string);
 procedure HelpIndex(Keyword: string);
 procedure HelpTopicSearch(Editor: PEditor);
 procedure HelpTopicSearch(Editor: PEditor);
 procedure HelpTopic(const S: string);
 procedure HelpTopic(const S: string);
+procedure CloseHelpWindows;
 
 
 procedure InitHelpSystem;
 procedure InitHelpSystem;
 procedure DoneHelpSystem;
 procedure DoneHelpSystem;
@@ -56,7 +57,7 @@ const
 
 
 implementation
 implementation
 
 
-uses Objects,Views,App,MsgBox,
+uses Objects,Views,App,MsgBox,Commands,
      WHTMLHlp,
      WHTMLHlp,
      FPConst,FPVars,FPUtils;
      FPConst,FPVars,FPUtils;
 
 
@@ -384,10 +385,43 @@ begin
     Dispose(HelpFiles, Done);
     Dispose(HelpFiles, Done);
 end;
 end;
 
 
+procedure CloseHelpWindows;
+procedure CloseIfHelpWindow(P: PView); {$ifndef FPC}far;{$endif}
+begin
+  if P^.HelpCtx=hcHelpWindow then
+    Message(P,evCommand,cmClose,nil);
+end;
+begin
+  Desktop^.ForEach(@CloseIfHelpWindow);
+end;
+
+
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.19  1999-07-12 13:14:17  pierre
+  Revision 1.20  1999-08-03 20:22:31  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.19  1999/07/12 13:14:17  pierre
     * LineEnd bug corrected, now goes end of text even if selected
     * LineEnd bug corrected, now goes end of text even if selected
     + Until Return for debugger
     + Until Return for debugger
     + Code for Quit inside GDB Window
     + Code for Quit inside GDB Window

+ 94 - 27
ide/text/fpide.pas

@@ -27,11 +27,13 @@ type
 
 
     TIDEApp = object(TApplication)
     TIDEApp = object(TApplication)
       constructor Init;
       constructor Init;
+      procedure   InitDesktop; virtual;
       procedure   InitMenuBar; virtual;
       procedure   InitMenuBar; virtual;
       procedure   InitStatusLine; virtual;
       procedure   InitStatusLine; virtual;
       procedure   Open(FileName: string);
       procedure   Open(FileName: string);
       function    OpenSearch(FileName: string) : boolean;
       function    OpenSearch(FileName: string) : boolean;
       function    SaveAll: boolean;
       function    SaveAll: boolean;
+      function    AutoSave: boolean;
       procedure   Idle; virtual;
       procedure   Idle; virtual;
       procedure   Update;
       procedure   Update;
       procedure   UpdateTarget;
       procedure   UpdateTarget;
@@ -60,7 +62,7 @@ type
       procedure DoRun;
       procedure DoRun;
       procedure DoResetDebugger;
       procedure DoResetDebugger;
       procedure DoContToCursor;
       procedure DoContToCursor;
-      procedure DoContUntilReturn; 
+      procedure DoContUntilReturn;
       procedure Target;
       procedure Target;
       procedure DoCompilerMessages;
       procedure DoCompilerMessages;
       procedure DoPrimaryFile;
       procedure DoPrimaryFile;
@@ -107,7 +109,7 @@ type
       procedure HelpFiles;
       procedure HelpFiles;
       procedure About;
       procedure About;
     private
     private
-      procedure DoExecute(ProgramPath, Params, InFile, OutFile: string; ExecType: TExecType);
+      function  DoExecute(ProgramPath, Params, InFile, OutFile: string; ExecType: TExecType): boolean;
     private
     private
       procedure AddRecentFile(AFileName: string; CurX, CurY: integer);
       procedure AddRecentFile(AFileName: string; CurX, CurY: integer);
       function  SearchRecentFile(AFileName: string): integer;
       function  SearchRecentFile(AFileName: string): integer;
@@ -137,7 +139,8 @@ uses
   Systems,
   Systems,
   WUtils,WHelp,WHlpView,WINI,WViews,
   WUtils,WHelp,WHlpView,WINI,WViews,
   FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompile,FPHelp,
   FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompile,FPHelp,
-  FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir;
+  FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
+  FPDesk;
 
 
 
 
 function IDEUseSyntaxHighlight(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
 function IDEUseSyntaxHighlight(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
@@ -184,6 +187,16 @@ begin
   Insert(HeapView);
   Insert(HeapView);
 end;
 end;
 
 
+procedure TIDEApp.InitDesktop;
+var
+  R: TRect;
+begin
+  GetExtent(R);
+  Inc(R.A.Y);
+  Dec(R.B.Y);
+  Desktop:=New(PFPDesktop, Init(R));
+end;
+
 procedure TIDEApp.InitMenuBar;
 procedure TIDEApp.InitMenuBar;
 var R: TRect;
 var R: TRect;
 begin
 begin
@@ -550,32 +563,64 @@ begin
   UpdateScreen(true);
   UpdateScreen(true);
 end;
 end;
 
 
-
-procedure TIDEApp.DoExecute(ProgramPath, Params, InFile,OutFile: string; ExecType: TExecType);
+function TIDEApp.AutoSave: boolean;
+var IOK,SOK,DOK: boolean;
 begin
 begin
-  if UserScreen=nil then
-   begin
-     ErrorBox('Sorry, user screen not available.',nil);
-     Exit;
-   end;
-
-  if ExecType<>exNoSwap then
-    ShowUserScreen;
-
-  if ExecType=exDosShell then
-    WriteShellMsg;
+  IOK:=true; SOK:=true; DOK:=true;
+  if (AutoSaveOptions and asEnvironment)<>0 then
+    begin
+      IOK:=WriteINIFile;
+      if IOK=false then
+        ErrorBox('Error saving configuration.',nil);
+    end;
+  if (AutoSaveOptions and asEditorFiles)=0 then
+      SOK:=MyApp.SaveAll;
+  if (AutoSaveOptions and asDesktop)<>0 then
+    begin
+      { destory all help & browser windows - we don't want to store them }
+      CloseHelpWindows;
+      CloseAllBrowsers;
+      DOK:=SaveDesktop;
+      if DOK=false then
+        ErrorBox('Error saving desktop file.',nil);
+    end;
+  AutoSave:=IOK and SOK and DOK;
+end;
 
 
-{$ifdef linux}
-  Shell(ProgramPath+' '+Params);
-{$else}
-  if (InFile='') and (OutFile='') then
-    Dos.Exec(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params)
-  else
-    ExecuteRedir(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params,InFile,OutFile,'stderr');
-{$endif}
+function TIDEApp.DoExecute(ProgramPath, Params, InFile,OutFile: string; ExecType: TExecType): boolean;
+var CanRun: boolean;
+begin
+  SaveCancelled:=false;
+  CanRun:=AutoSave;
+  if (CanRun=false) and (SaveCancelled=false) then
+    CanRun:=true; { do not care about .DSK or .INI saving problems - just like TP }
+  if CanRun then
+  begin
+    if UserScreen=nil then
+     begin
+       ErrorBox('Sorry, user screen not available.',nil);
+       Exit;
+     end;
+
+    if ExecType<>exNoSwap then
+      ShowUserScreen;
+
+    if ExecType=exDosShell then
+      WriteShellMsg;
+
+  {$ifdef linux}
+    Shell(ProgramPath+' '+Params);
+  {$else}
+    if (InFile='') and (OutFile='') then
+      Dos.Exec(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params)
+    else
+      ExecuteRedir(GetEnv('COMSPEC'),'/C '+ProgramPath+' '+Params,InFile,OutFile,'stderr');
+  {$endif}
 
 
-  if ExecType<>exNoSwap then
-    ShowIDEScreen;
+    if ExecType<>exNoSwap then
+      ShowIDEScreen;
+  end;
+  DoExecute:=CanRun;
 end;
 end;
 
 
 
 
@@ -769,7 +814,29 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.33  1999-07-12 13:14:18  pierre
+  Revision 1.34  1999-08-03 20:22:32  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.33  1999/07/12 13:14:18  pierre
     * LineEnd bug corrected, now goes end of text even if selected
     * LineEnd bug corrected, now goes end of text even if selected
     + Until Return for debugger
     + Until Return for debugger
     + Code for Quit inside GDB Window
     + Code for Quit inside GDB Window

+ 34 - 8
ide/text/fpini.pas

@@ -22,8 +22,8 @@ uses
 const
 const
     ININame = 'fp.ini';
     ININame = 'fp.ini';
 
 
-    ConfigDir  : string = '.'+DirSep;
-    INIFileName: string = ININame;
+    ConfigDir  : string{$ifdef GABOR}[50]{$endif} = '.'+DirSep;
+    INIFileName: string{$ifdef GABOR}[50]{$endif} = ININame;
 
 
 
 
 procedure InitINIFile;
 procedure InitINIFile;
@@ -57,8 +57,8 @@ const
 
 
   { INI file tags }
   { INI file tags }
   ieRecentFile       = 'RecentFile';
   ieRecentFile       = 'RecentFile';
-  ieOpenFile         = 'OpenFile';
-  ieOpenFileCount    = 'OpenFileCount';
+(*  ieOpenFile         = 'OpenFile';
+  ieOpenFileCount    = 'OpenFileCount'; *)
   ieRunParameters    = 'Parameters';
   ieRunParameters    = 'Parameters';
   iePrimaryFile      = 'PrimaryFile';
   iePrimaryFile      = 'PrimaryFile';
   ieCompileMode      = 'CompileMode';
   ieCompileMode      = 'CompileMode';
@@ -309,7 +309,7 @@ begin
   PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_161_200',PaletteToStr(copy(S,161,40))));
   PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_161_200',PaletteToStr(copy(S,161,40))));
   PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_201_240',PaletteToStr(copy(S,201,40))));
   PS:=PS+StrToPalette(INIFile^.GetEntry(secColors,iePalette+'_201_240',PaletteToStr(copy(S,201,40))));
   AppPalette:=PS;
   AppPalette:=PS;
-  { Open files }
+(*  { Open files }
   for I:=INIFile^.GetIntEntry(secFiles,ieOpenFileCount,0) downto 1 do
   for I:=INIFile^.GetIntEntry(secFiles,ieOpenFileCount,0) downto 1 do
     begin
     begin
       S:=INIFile^.GetEntry(secFiles,ieOpenFile+IntToStr(I),'');
       S:=INIFile^.GetEntry(secFiles,ieOpenFile+IntToStr(I),'');
@@ -348,6 +348,7 @@ begin
       { remove it because otherwise we allways keep old files }
       { remove it because otherwise we allways keep old files }
       INIFile^.DeleteEntry(secFiles,ieOpenFile+IntToStr(I));
       INIFile^.DeleteEntry(secFiles,ieOpenFile+IntToStr(I));
     end;
     end;
+*)
   { Desktop }
   { Desktop }
   DesktopFileFlags:=INIFile^.GetIntEntry(secPreferences,ieDesktopFlags,DesktopFileFlags);
   DesktopFileFlags:=INIFile^.GetIntEntry(secPreferences,ieDesktopFlags,DesktopFileFlags);
   { Preferences }
   { Preferences }
@@ -366,7 +367,7 @@ var INIFile: PINIFile;
     S1,S2,S3: string;
     S1,S2,S3: string;
     W: word;
     W: word;
     BreakPointCount:longint;
     BreakPointCount:longint;
-    I,OpenFileCount: integer;
+    I(*,OpenFileCount*): integer;
     OK: boolean;
     OK: boolean;
     PW,PPW : PSourceWindow;
     PW,PPW : PSourceWindow;
 
 
@@ -378,7 +379,7 @@ end;
 begin
 begin
   New(INIFile, Init(INIPath));
   New(INIFile, Init(INIPath));
   { Files }
   { Files }
-  { avoid keeping old files } 
+  { avoid keeping old files }
   INIFile^.DeleteSection(secFiles);
   INIFile^.DeleteSection(secFiles);
   INIFile^.SetEntry(secFiles,ieOpenExts,'"'+OpenExts+'"');
   INIFile^.SetEntry(secFiles,ieOpenExts,'"'+OpenExts+'"');
   for I:=1 to High(RecentFiles) do
   for I:=1 to High(RecentFiles) do
@@ -390,6 +391,7 @@ begin
       INIFile^.SetEntry(secFiles,ieRecentFile+IntToStr(I),S);
       INIFile^.SetEntry(secFiles,ieRecentFile+IntToStr(I),S);
     end;
     end;
 
 
+(*
     PW:=FirstEditorWindow;
     PW:=FirstEditorWindow;
     PPW:=PW;
     PPW:=PW;
     I:=1;
     I:=1;
@@ -413,7 +415,9 @@ begin
         If PW=PPW then
         If PW=PPW then
           break;
           break;
       end;
       end;
+
   INIFile^.SetIntEntry(secFiles,ieOpenFileCount,OpenFileCount);
   INIFile^.SetIntEntry(secFiles,ieOpenFileCount,OpenFileCount);
+*)
   { Run }
   { Run }
   INIFile^.SetEntry(secRun,ieRunParameters,GetRunParameters);
   INIFile^.SetEntry(secRun,ieRunParameters,GetRunParameters);
   { Compile }
   { Compile }
@@ -490,7 +494,29 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.20  1999-06-28 12:36:51  pierre
+  Revision 1.21  1999-08-03 20:22:33  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.20  1999/06/28 12:36:51  pierre
    * avoid keeping old open file names
    * avoid keeping old open file names
 
 
   Revision 1.19  1999/04/07 21:55:48  peter
   Revision 1.19  1999/04/07 21:55:48  peter

+ 24 - 2
ide/text/fpmfile.inc

@@ -95,7 +95,7 @@ begin
          ChDir(Copy(FileDir,1,2));
          ChDir(Copy(FileDir,1,2));
        end;
        end;
      ChDir(FileDir);
      ChDir(FileDir);
-     New(D, Init(OpenExts,'Open a file','File to open',fdOpenButton,0));
+     New(D, Init(OpenExts,'Open a file','File to ope~n~',fdOpenButton,0));
      OpenIt:=Desktop^.ExecView(D)<>cmCancel;
      OpenIt:=Desktop^.ExecView(D)<>cmCancel;
      if OpenIt then
      if OpenIt then
        Begin
        Begin
@@ -179,7 +179,29 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.11  1999-06-25 00:35:54  pierre
+  Revision 1.12  1999-08-03 20:22:34  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.11  1999/06/25 00:35:54  pierre
    + uses weditor FileDir var to remember Directory for Open/Save
    + uses weditor FileDir var to remember Directory for Open/Save
 
 
   Revision 1.10  1999/03/23 15:11:32  peter
   Revision 1.10  1999/03/23 15:11:32  peter

+ 26 - 2
ide/text/fpmtools.inc

@@ -51,6 +51,7 @@ var Title,ProgramPath,Params: string;
     Err: integer;
     Err: integer;
     CaptureFile: string;
     CaptureFile: string;
     ExecMode: TExecType;
     ExecMode: TExecType;
+    Executed: boolean;
 begin
 begin
   if (Idx<1) or (Idx>GetToolCount) then Exit;
   if (Idx<1) or (Idx>GetToolCount) then Exit;
   GetToolParams(Idx-1,Title,ProgramPath,Params,Wo);
   GetToolParams(Idx-1,Title,ProgramPath,Params,Wo);
@@ -82,11 +83,12 @@ begin
   if CaptureToolTo<>capNone then
   if CaptureToolTo<>capNone then
     ShowMessage('Executing tool '+KillTilde(Title)+'...');
     ShowMessage('Executing tool '+KillTilde(Title)+'...');
 
 
-  DoExecute(ProgramPath,Params,'',CaptureFile,ExecMode);
+  Executed:=DoExecute(ProgramPath,Params,'',CaptureFile,ExecMode);
 
 
   if CaptureToolTo<>capNone then
   if CaptureToolTo<>capNone then
     HideMessage;
     HideMessage;
 
 
+  if Executed then
   if (DosError=0) and (DosExitCode=0) then
   if (DosError=0) and (DosExitCode=0) then
     begin
     begin
       if CaptureToolTo=capEditWindow then
       if CaptureToolTo=capEditWindow then
@@ -260,7 +262,29 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1999-07-12 13:14:20  pierre
+  Revision 1.13  1999-08-03 20:22:35  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.12  1999/07/12 13:14:20  pierre
     * LineEnd bug corrected, now goes end of text even if selected
     * LineEnd bug corrected, now goes end of text even if selected
     + Until Return for debugger
     + Until Return for debugger
     + Code for Quit inside GDB Window
     + Code for Quit inside GDB Window

+ 37 - 99
ide/text/fpredir.pas

@@ -509,7 +509,7 @@ procedure RedirDisableAll;
     If RedirChangedError and not ErrorRedirDisabled then
     If RedirChangedError and not ErrorRedirDisabled then
       DisableRedirError;
       DisableRedirError;
   end;
   end;
-  
+
 {............................................................................}
 {............................................................................}
 
 
 procedure RedirEnableAll;
 procedure RedirEnableAll;
@@ -536,22 +536,19 @@ end;
                                  Linux
                                  Linux
 *****************************************************************************}
 *****************************************************************************}
 
 
-function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
-
-  begin
-     ExecuteRedir:=false;
-  end;
+function ExecuteRedir (Const ProgName, ComLine, RedirStdOut, RedirStdErr : String) : boolean;
+begin
+  ExecuteRedir:=false;
+end;
 
 
 function ChangeRedir(Const Redir : String; AppendToFile : Boolean) : Boolean;
 function ChangeRedir(Const Redir : String; AppendToFile : Boolean) : Boolean;
-
-  begin
-     ChangeRedir:=false;
-  end;
+begin
+  ChangeRedir:=false;
+end;
 
 
 procedure RestoreRedir;
 procedure RestoreRedir;
-
-  begin
-  end;
+begin
+end;
 
 
 function ChangeErrorRedir(Const Redir : String; AppendToFile : Boolean) : Boolean;
 function ChangeErrorRedir(Const Redir : String; AppendToFile : Boolean) : Boolean;
 begin
 begin
@@ -559,87 +556,12 @@ begin
 end;
 end;
 
 
 procedure RestoreErrorRedir;
 procedure RestoreErrorRedir;
-
-  begin
-  end;
+begin
+end;
 
 
 procedure InitRedir;
 procedure InitRedir;
-
-  begin
-  end;
-
-function  ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
-
-  begin
-     ChangeReDirOut:=false;
-  end;
-
-procedure RestoreRedirOut;
-
-  begin
-  end;
-
-procedure DisableRedirOut;
-
-  begin
-  end;
-
-procedure EnableRedirOut;
-
-  begin
-  end;
-
-function  ChangeRedirIn(Const Redir : String) : Boolean;
-
-  begin
-     ChangeRedirIn:=false;
-  end;
-
-procedure RestoreRedirIn;
-
-  begin
-  end;
-
-procedure DisableRedirIn;
-
-  begin
-  end;
-
-procedure EnableRedirIn;
-
-  begin
-  end;
-
-function  ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolean;
-
-  begin
-     ChangeRedirError:=false;
-  end;
-
-procedure RestoreRedirError;
-
-  begin
-  end;
-
-procedure DisableRedirError;
-
-  begin
-  end;
-
-procedure EnableRedirError;
-
-  begin
-  end;
-
-procedure RedirDisableAll;
-
-  begin
-  end;
-
-procedure RedirEnableAll;
-
-  begin
-  end;
+begin
+end;
 
 
 {$endif not implemented}
 {$endif not implemented}
 
 
@@ -647,10 +569,10 @@ procedure RedirEnableAll;
 {*****************************************************************************
 {*****************************************************************************
                                   Initialize
                                   Initialize
 *****************************************************************************}
 *****************************************************************************}
-{$ifdef implemented}
+
 var oldexit : pointer;
 var oldexit : pointer;
 
 
-procedure RedirExit;
+procedure RedirExit; {$ifndef FPC}far;{$endif}
 begin
 begin
   exitproc:=oldexit;
   exitproc:=oldexit;
   Dispose(FIn); Dispose(FOut); Dispose(FErr);
   Dispose(FIn); Dispose(FOut); Dispose(FErr);
@@ -661,13 +583,29 @@ Begin
   exitproc:=@RedirExit;
   exitproc:=@RedirExit;
   New(FIn); New(FOut); New(FErr);
   New(FIn); New(FOut); New(FErr);
 End.
 End.
-{$else implemented}
-end.
-{$endif implemented}
 {
 {
   $Log$
   $Log$
-  Revision 1.18  1999-07-18 16:26:39  florian
-    * IDE compiles with for Win32 and basic things are working
+  Revision 1.19  1999-08-03 20:22:36  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
 
 
   Revision 1.17  1999/05/01 23:45:07  pierre
   Revision 1.17  1999/05/01 23:45:07  pierre
    * FIn FOut FErr dispsoed at exit
    * FIn FOut FErr dispsoed at exit

+ 24 - 2
ide/text/fptools.pas

@@ -136,7 +136,7 @@ procedure ClearToolMessages;
 procedure UpdateToolMessages;
 procedure UpdateToolMessages;
 
 
 const
 const
-     ToolFilter     : string[128]      = '';
+     ToolFilter     : string[{$ifndef GABOR}128{$else}40{$endif}]      = '';
      CaptureToolTo  : TCaptureTarget   = capNone;
      CaptureToolTo  : TCaptureTarget   = capNone;
      ToolMessages   : PCollection      = nil;
      ToolMessages   : PCollection      = nil;
      ToolModuleNames: PStoreCollection = nil;
      ToolModuleNames: PStoreCollection = nil;
@@ -1505,7 +1505,29 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1999-07-28 23:11:24  peter
+  Revision 1.13  1999-08-03 20:22:37  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.12  1999/07/28 23:11:24  peter
     * fixes from gabor
     * fixes from gabor
 
 
   Revision 1.11  1999/07/12 13:14:21  pierre
   Revision 1.11  1999/07/12 13:14:21  pierre

+ 40 - 18
ide/text/fpvars.pas

@@ -23,7 +23,7 @@ uses Objects,Views,App,
 
 
 type
 type
     TRecentFileEntry = record
     TRecentFileEntry = record
-      FileName  : string{$ifdef GABOR}[20]{$endif};
+      FileName  : string{$ifdef GABOR}[80]{$endif};
       LastPos   : TPoint;
       LastPos   : TPoint;
     end;
     end;
 
 
@@ -33,19 +33,19 @@ type
 const ClipboardWindow  : PClipboardWindow = nil;
 const ClipboardWindow  : PClipboardWindow = nil;
       CalcWindow       : PCalculator = nil;
       CalcWindow       : PCalculator = nil;
       RecentFileCount  : integer = 0;
       RecentFileCount  : integer = 0;
-      OpenExts         : string{$ifdef GABOR}[24]{$endif} = '*.pas;*.pp;*.inc';
-      HighlightExts    : string{$ifdef GABOR}[24]{$endif} = '*.pas;*.pp;*.inc';
-      TabsPattern      : string{$ifdef GABOR}[30]{$endif} = 'make*;make*.*';
-      SourceDirs       : string{$ifdef GABOR}[30]{$endif} = '';
-      PrimaryFile      : string{$ifdef GABOR}[60]{$endif} = '';
-      PrimaryFileMain  : string{$ifdef GABOR}[60]{$endif} = '';
-      PrimaryFileSwitches : string{$ifdef GABOR}[30]{$endif} = '';
-      PrimaryFilePara  : string{$ifdef GABOR}[40]{$endif} = '';
-      GDBOutputFile    : string{$ifdef GABOR}[30]{$endif} = 'gdb$$$.txt';
+      OpenExts         : string{$ifdef GABOR}[40]{$endif} = '*.pas;*.pp;*.inc';
+      HighlightExts    : string{$ifdef GABOR}[40]{$endif} = '*.pas;*.pp;*.inc';
+      TabsPattern      : string{$ifdef GABOR}[40]{$endif} = 'make*;make*.*';
+      SourceDirs       : string{$ifdef GABOR}[40]{$endif} = '';
+      PrimaryFile      : string{$ifdef GABOR}[80]{$endif} = '';
+      PrimaryFileMain  : string{$ifdef GABOR}[80]{$endif} = '';
+      PrimaryFileSwitches : string{$ifdef GABOR}[80]{$endif} = '';
+      PrimaryFilePara  : string{$ifdef GABOR}[80]{$endif} = '';
+      GDBOutputFile    : string{$ifdef GABOR}[80]{$endif} = GDBOutputFileName;
       IsEXECompiled    : boolean = false;
       IsEXECompiled    : boolean = false;
       LinkAfter        : boolean = true;
       LinkAfter        : boolean = true;
-      MainFile         : string{$ifdef GABOR}[60]{$endif} = '';
-      EXEFile          : string{$ifdef GABOR}[60]{$endif} = '';
+      MainFile         : string{$ifdef GABOR}[80]{$endif} = '';
+      EXEFile          : string{$ifdef GABOR}[80]{$endif} = '';
       CompilationPhase : TCompPhase = cpNothing;
       CompilationPhase : TCompPhase = cpNothing;
       ProgramInfoWindow: PProgramInfoWindow = nil;
       ProgramInfoWindow: PProgramInfoWindow = nil;
       GDBWindow        : PGDBWindow = nil;
       GDBWindow        : PGDBWindow = nil;
@@ -55,16 +55,16 @@ const ClipboardWindow  : PClipboardWindow = nil;
       HeapView         : PFPHeapView = nil;
       HeapView         : PFPHeapView = nil;
       HelpFiles        : WUtils.PUnsortedStringCollection = nil;
       HelpFiles        : WUtils.PUnsortedStringCollection = nil;
       ShowStatusOnError: boolean = true;
       ShowStatusOnError: boolean = true;
-      StartupDir       : string{$ifdef GABOR}[50]{$endif} = '.'+DirSep;
-      IDEDir           : string{$ifdef GABOR}[50]{$endif} = '.'+DirSep;
-      INIPath          : string{$ifdef GABOR}[50]{$endif} = ININame;
-      SwitchesPath     : string{$ifdef GABOR}[50]{$endif} = SwitchesName;
+      StartupDir       : string{$ifdef GABOR}[80]{$endif} = '.'+DirSep;
+      IDEDir           : string{$ifdef GABOR}[80]{$endif} = '.'+DirSep;
+      INIPath          : string{$ifdef GABOR}[80]{$endif} = ININame;
+      SwitchesPath     : string{$ifdef GABOR}[80]{$endif} = SwitchesName;
       CtrlMouseAction  : integer = acTopicSearch;
       CtrlMouseAction  : integer = acTopicSearch;
       AltMouseAction   : integer = acBrowseSymbol;
       AltMouseAction   : integer = acBrowseSymbol;
       StartupOptions   : longint = 0;
       StartupOptions   : longint = 0;
       LastExitCode     : integer = 0;
       LastExitCode     : integer = 0;
       ASCIIChart       : PFPASCIIChart = nil;
       ASCIIChart       : PFPASCIIChart = nil;
-      DesktopPath      : string{$ifdef GABOR}[50]{$endif} = DesktopName;
+      DesktopPath      : string{$ifdef GABOR}[80]{$endif} = DesktopName;
       DesktopFileFlags : longint = dfHistoryLists+dfOpenWindows;
       DesktopFileFlags : longint = dfHistoryLists+dfOpenWindows;
       DesktopLocation  : byte    = dlConfigFileDir;
       DesktopLocation  : byte    = dlConfigFileDir;
       AutoSaveOptions  : longint = asEnvironment+asDesktop;
       AutoSaveOptions  : longint = asEnvironment+asDesktop;
@@ -83,7 +83,29 @@ implementation
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.20  1999-07-28 23:11:25  peter
+  Revision 1.21  1999-08-03 20:22:38  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.20  1999/07/28 23:11:25  peter
     * fixes from gabor
     * fixes from gabor
 
 
   Revision 1.19  1999/07/10 01:24:21  pierre
   Revision 1.19  1999/07/10 01:24:21  pierre

+ 107 - 9
ide/text/fpviews.pas

@@ -55,8 +55,11 @@ type
 
 
     TFPWindow = object(TWindow)
     TFPWindow = object(TWindow)
       AutoNumber: boolean;
       AutoNumber: boolean;
-      procedure HandleEvent(var Event: TEvent); virtual;
-      procedure SetState(AState: Word; Enable: Boolean); virtual;
+      procedure   HandleEvent(var Event: TEvent); virtual;
+      procedure   SetState(AState: Word; Enable: Boolean); virtual;
+      constructor Load(var S: TStream);
+      procedure   Store(var S: TStream);
+      procedure   Update;
     end;
     end;
 
 
     PFPHelpViewer = ^TFPHelpViewer;
     PFPHelpViewer = ^TFPHelpViewer;
@@ -73,6 +76,8 @@ type
       procedure   Hide; virtual;
       procedure   Hide; virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       function    GetPalette: PPalette; virtual;
       function    GetPalette: PPalette; virtual;
+      constructor Load(var S: TStream);
+      procedure   Store(var S: TStream);
     end;
     end;
 
 
     PTextScroller = ^TTextScroller;
     PTextScroller = ^TTextScroller;
@@ -241,6 +246,7 @@ type
       function    AtTab(Index: integer): PTabDef; virtual;
       function    AtTab(Index: integer): PTabDef; virtual;
       procedure   SelectTab(Index: integer); virtual;
       procedure   SelectTab(Index: integer); virtual;
       function    TabCount: integer;
       function    TabCount: integer;
+      procedure   SelectNextTab(Forwards: boolean);
       function    Valid(Command: Word): Boolean; virtual;
       function    Valid(Command: Word): Boolean; virtual;
       procedure   ChangeBounds(var Bounds: TRect); virtual;
       procedure   ChangeBounds(var Bounds: TRect); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
       procedure   HandleEvent(var Event: TEvent); virtual;
@@ -291,6 +297,12 @@ type
       function    GetText(Item: pointer; MaxLen: sw_integer): string; virtual;
       function    GetText(Item: pointer; MaxLen: sw_integer): string; virtual;
     end;
     end;
 
 
+    PFPDesktop = ^TFPDesktop;
+    TFPDesktop = object(TDesktop)
+      constructor Load(var S: TStream);
+      procedure   Store(var S: TStream);
+    end;
+
 function  SearchFreeWindowNo: integer;
 function  SearchFreeWindowNo: integer;
 
 
 function IsThereAnyEditor: boolean;
 function IsThereAnyEditor: boolean;
@@ -331,7 +343,7 @@ const
 
 
       CalcClipboard   : extended = 0;
       CalcClipboard   : extended = 0;
 
 
-      OpenFileName    : string = '';
+      OpenFileName    : string{$ifdef GABOR}[50]{$endif} = '';
       OpenFileLastExt : string[12] = '*.pas';
       OpenFileLastExt : string[12] = '*.pas';
       NewEditorOpened : boolean = false;
       NewEditorOpened : boolean = false;
 
 
@@ -353,7 +365,8 @@ uses
   gdbint,
   gdbint,
 {$endif NODEBUG}
 {$endif NODEBUG}
   {$ifdef VESA}Vesa,{$endif}
   {$ifdef VESA}Vesa,{$endif}
-  FPSwitch,FPSymbol,FPDebug,FPVars,FPUtils,FPCompile,FPHelp;
+  FPSwitch,FPSymbol,FPDebug,FPVars,FPUtils,FPCompile,FPHelp,
+  FPTools;
 
 
 const
 const
   RSourceEditor: TStreamRec = (
   RSourceEditor: TStreamRec = (
@@ -392,6 +405,12 @@ const
      Load:    @TMessageListBox.Load;
      Load:    @TMessageListBox.Load;
      Store:   @TMessageListBox.Store
      Store:   @TMessageListBox.Store
   );
   );
+  RFPDesktop: TStreamRec = (
+     ObjType: 1506;
+     VmtLink: Ofs(TypeOf(TFPDesktop)^);
+     Load:    @TFPDesktop.Load;
+     Store:   @TFPDesktop.Store
+  );
 
 
 
 
 const
 const
@@ -829,13 +848,18 @@ begin
         Number:=0;
         Number:=0;
 end;
 end;
 
 
+procedure TFPWindow.Update;
+begin
+  ReDraw;
+end;
+
 procedure TFPWindow.HandleEvent(var Event: TEvent);
 procedure TFPWindow.HandleEvent(var Event: TEvent);
 begin
 begin
   case Event.What of
   case Event.What of
     evBroadcast :
     evBroadcast :
       case Event.Command of
       case Event.Command of
         cmUpdate :
         cmUpdate :
-          ReDraw;
+          Update;
         cmSearchWindow+1..cmSearchWindow+99 :
         cmSearchWindow+1..cmSearchWindow+99 :
           if (Event.Command-cmSearchWindow=Number) then
           if (Event.Command-cmSearchWindow=Number) then
               ClearEvent(Event);
               ClearEvent(Event);
@@ -844,6 +868,19 @@ begin
   inherited HandleEvent(Event);
   inherited HandleEvent(Event);
 end;
 end;
 
 
+
+constructor TFPWindow.Load(var S: TStream);
+begin
+  inherited Load(S);
+  S.Read(AutoNumber,SizeOf(AutoNumber));
+end;
+
+procedure TFPWindow.Store(var S: TStream);
+begin
+  inherited Store(S);
+  S.Write(AutoNumber,SizeOf(AutoNumber));
+end;
+
 function TFPHelpViewer.GetLocalMenu: PMenu;
 function TFPHelpViewer.GetLocalMenu: PMenu;
 var M: PMenu;
 var M: PMenu;
 begin
 begin
@@ -917,6 +954,16 @@ begin
   GetPalette:=@P;
   GetPalette:=@P;
 end;
 end;
 
 
+constructor TFPHelpWindow.Load(var S: TStream);
+begin
+  Abstract;
+end;
+
+procedure TFPHelpWindow.Store(var S: TStream);
+begin
+  Abstract;
+end;
+
 constructor TSourceWindow.Init(var Bounds: TRect; AFileName: string);
 constructor TSourceWindow.Init(var Bounds: TRect; AFileName: string);
 var HSB,VSB: PScrollBar;
 var HSB,VSB: PScrollBar;
     R: TRect;
     R: TRect;
@@ -1505,14 +1552,16 @@ end;
 
 
 procedure TMessageListBox.Store(var S: TStream);
 procedure TMessageListBox.Store(var S: TStream);
 var OL: PCollection;
 var OL: PCollection;
+    ORV: sw_integer;
 begin
 begin
-  OL:=List;
-  New(List, Init(1,1));
+  OL:=List; ORV:=Range;
+
+  New(List, Init(1,1)); Range:=0;
 
 
   inherited Store(S);
   inherited Store(S);
 
 
   Dispose(List, Done);
   Dispose(List, Done);
-  List:=OL;
+  List:=OL; Range:=ORV;
   { ^^^ nasty trick - has anyone a better idea how to avoid storing the
   { ^^^ nasty trick - has anyone a better idea how to avoid storing the
     collection? Pasting here a modified version of TListBox.Store+
     collection? Pasting here a modified version of TListBox.Store+
     TAdvancedListBox.Store isn't a better solution, since by eventually
     TAdvancedListBox.Store isn't a better solution, since by eventually
@@ -1788,6 +1837,17 @@ begin
     end;
     end;
 end;
 end;
 
 
+procedure TTab.SelectNextTab(Forwards: boolean);
+var Index: integer;
+begin
+  Index:=ActiveDef;
+  if Index=-1 then Exit;
+  if Forwards then Inc(Index) else Dec(Index);
+  if Index<0 then Index:=DefCount-1 else
+  if Index>DefCount-1 then Index:=0;
+  SelectTab(Index);
+end;
+
 procedure TTab.HandleEvent(var Event: TEvent);
 procedure TTab.HandleEvent(var Event: TEvent);
 var Index : integer;
 var Index : integer;
     I     : integer;
     I     : integer;
@@ -1841,6 +1901,11 @@ begin
      begin
      begin
        Index:=-1;
        Index:=-1;
        case Event.KeyCode of
        case Event.KeyCode of
+            kbCtrlTab :
+              begin
+                SelectNextTab((Event.KeyShift and kbShift)=0);
+                ClearEvent(Event);
+              end;
             kbTab,kbShiftTab  :
             kbTab,kbShiftTab  :
               if GetState(sfSelected) then
               if GetState(sfSelected) then
                  begin
                  begin
@@ -2581,6 +2646,16 @@ begin
   GetText:=copy(S,1,MaxLen);
   GetText:=copy(S,1,MaxLen);
 end;
 end;
 
 
+constructor TFPDesktop.Load(var S: TStream);
+begin
+  inherited Load(S);
+end;
+
+procedure TFPDesktop.Store(var S: TStream);
+begin
+  inherited Store(S);
+end;
+
 {$ifdef VESA}
 {$ifdef VESA}
 function VESASetVideoModeProc(const VideoMode: TVideoMode; Params: Longint): Boolean; {$ifndef FPC}far;{$endif}
 function VESASetVideoModeProc(const VideoMode: TVideoMode; Params: Longint): Boolean; {$ifndef FPC}far;{$endif}
 begin
 begin
@@ -2618,13 +2693,36 @@ begin
   RegisterType(RFPHelpWindow);
   RegisterType(RFPHelpWindow);
   RegisterType(RClipboardWindow);
   RegisterType(RClipboardWindow);
   RegisterType(RMessageListBox);
   RegisterType(RMessageListBox);
+  RegisterType(RFPDesktop);
 end;
 end;
 
 
 
 
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.35  1999-07-12 13:14:22  pierre
+  Revision 1.36  1999-08-03 20:22:39  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.35  1999/07/12 13:14:22  pierre
     * LineEnd bug corrected, now goes end of text even if selected
     * LineEnd bug corrected, now goes end of text even if selected
     + Until Return for debugger
     + Until Return for debugger
     + Code for Quit inside GDB Window
     + Code for Quit inside GDB Window

+ 2 - 2
ide/text/globdir.inc

@@ -20,7 +20,7 @@
 {$endif}
 {$endif}
 
 
 { --- Include VESA support --- }
 { --- Include VESA support --- }
-{$ifdef GO32V2}
+{$ifndef LINUX}
   {$ifndef FV20}
   {$ifndef FV20}
     {$define VESA}
     {$define VESA}
   {$endif}
   {$endif}
@@ -43,6 +43,6 @@
 {$endif}
 {$endif}
 
 
 {$ifdef GABOR}
 {$ifdef GABOR}
-  {$define NOOBJREG}
+  {.$define NOOBJREG}
   {$define NODEBUG}
   {$define NODEBUG}
 {$endif}
 {$endif}

+ 218 - 67
ide/text/weditor.pas

@@ -37,15 +37,9 @@ const
       cmReadBlock            = 51246;
       cmReadBlock            = 51246;
       cmPrintBlock           = 51247;
       cmPrintBlock           = 51247;
 
 
-{$ifdef FPC}
-      EditorTextBufSize = 32768;
-      MaxLineLength = 255;
-      MaxLineCount  = 16380;
-{$else}
-      EditorTextBufSize = 4096;
-      MaxLineLength = 255;
-      MaxLineCount  = 16380;
-{$endif}
+      EditorTextBufSize = {$ifdef FPC}32768{$else} 4096{$endif};
+      MaxLineLength     = {$ifdef FPC}  255{$else}  255{$endif};
+      MaxLineCount      = {$ifdef FPC}16380{$else}16380{$endif};
 
 
       efBackupFiles         = $00000001;
       efBackupFiles         = $00000001;
       efInsertMode          = $00000002;
       efInsertMode          = $00000002;
@@ -59,6 +53,7 @@ const
       efHighlightColumn     = $00000200;
       efHighlightColumn     = $00000200;
       efHighlightRow        = $00000400;
       efHighlightRow        = $00000400;
       efAutoBrackets        = $00000800;
       efAutoBrackets        = $00000800;
+      efStoreContent        = $80000000;
 
 
       attrAsm       = 1;
       attrAsm       = 1;
       attrComment   = 2;
       attrComment   = 2;
@@ -220,9 +215,10 @@ type
       procedure   LimitsChanged; virtual;
       procedure   LimitsChanged; virtual;
       procedure   SelectionChanged; virtual;
       procedure   SelectionChanged; virtual;
       procedure   HighlightChanged; virtual;
       procedure   HighlightChanged; virtual;
+      procedure   Update; virtual;
       procedure   ScrollTo(X, Y: sw_Integer);
       procedure   ScrollTo(X, Y: sw_Integer);
       procedure   SetInsertMode(InsertMode: boolean); virtual;
       procedure   SetInsertMode(InsertMode: boolean); virtual;
-      procedure   SetCurPtr(X, Y: sw_Integer); virtual;
+      procedure   SetCurPtr(X,Y: sw_integer); virtual;
       procedure   SetSelection(A, B: TPoint); virtual;
       procedure   SetSelection(A, B: TPoint); virtual;
       procedure   SetHighlight(A, B: TPoint); virtual;
       procedure   SetHighlight(A, B: TPoint); virtual;
       procedure   SetHighlightRow(Row: sw_integer); virtual;
       procedure   SetHighlightRow(Row: sw_integer); virtual;
@@ -233,6 +229,8 @@ type
       function    IsClipboard: Boolean;
       function    IsClipboard: Boolean;
       constructor Load(var S: TStream);
       constructor Load(var S: TStream);
       procedure   Store(var S: TStream);
       procedure   Store(var S: TStream);
+      function    LoadFromStream(Stream: PStream): boolean; virtual;
+      function    SaveToStream(Stream: PStream): boolean; virtual;
       destructor  Done; virtual;
       destructor  Done; virtual;
     public
     public
       { Text & info storage abstraction }
       { Text & info storage abstraction }
@@ -264,6 +262,7 @@ type
       Bookmarks   : array[0..9] of TEditorBookmark;
       Bookmarks   : array[0..9] of TEditorBookmark;
       LockFlag    : integer;
       LockFlag    : integer;
       DrawCalled  : boolean;
       DrawCalled  : boolean;
+      CurEvent    : PEvent;
       function    Overwrite: boolean;
       function    Overwrite: boolean;
       function    GetLine(I: sw_integer): PLine;
       function    GetLine(I: sw_integer): PLine;
       procedure   CheckSels;
       procedure   CheckSels;
@@ -272,6 +271,7 @@ type
       procedure   DrawLines(FirstLine: sw_integer);
       procedure   DrawLines(FirstLine: sw_integer);
       procedure   HideHighlight;
       procedure   HideHighlight;
       procedure   AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string);
       procedure   AddAction(AAction: byte; AStartPos, AEndPos: TPoint; AText: string);
+      function    ShouldExtend: boolean;
       function    ValidBlock: boolean;
       function    ValidBlock: boolean;
     public
     public
      { Syntax highlight support }
      { Syntax highlight support }
@@ -1050,7 +1050,7 @@ end;
 *****************************************************************************}
 *****************************************************************************}
 
 
 constructor TCodeEditor.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
 constructor TCodeEditor.Init(var Bounds: TRect; AHScrollBar, AVScrollBar:
-          PScrollBar; AIndicator: PIndicator; AbufSize:Sw_Word);
+          PScrollBar; AIndicator: PIndicator; ABufSize:Sw_Word);
 begin
 begin
   inherited Init(Bounds,AHScrollBar,AVScrollBar);
   inherited Init(Bounds,AHScrollBar,AVScrollBar);
   StoreUndo:=false;
   StoreUndo:=false;
@@ -1105,7 +1105,7 @@ procedure TCodeEditor.UnLock;
 begin
 begin
 {$ifdef DEBUG}
 {$ifdef DEBUG}
   if lockflag=0 then
   if lockflag=0 then
-    messagebox('Error: negative lockflag',nil,mferror+mfcancelbutton)
+    Bug('negative lockflag',nil)
   else
   else
 {$endif DEBUG}
 {$endif DEBUG}
     Dec(LockFlag);
     Dec(LockFlag);
@@ -1212,7 +1212,7 @@ var
 begin
 begin
   if Event.What = evKeyDown then
   if Event.What = evKeyDown then
   begin
   begin
-    if (GetShiftState and kbShift <> 0) and
+    if (Event.KeyShift and kbShift <> 0) and
       (Event.ScanCode >= $47) and (Event.ScanCode <= $51) then
       (Event.ScanCode >= $47) and (Event.ScanCode <= $51) then
       Event.CharCode := #0;
       Event.CharCode := #0;
     Key := Event.KeyCode;
     Key := Event.KeyCode;
@@ -1259,7 +1259,10 @@ var DontClear : boolean;
 
 
 var
 var
   StartP,P: TPoint;
   StartP,P: TPoint;
+  E: TEvent;
 begin
 begin
+  E:=Event;
+  CurEvent:=@E;
   if (InASCIIMode=false) or (Event.What<>evKeyDown) then
   if (InASCIIMode=false) or (Event.What<>evKeyDown) then
     ConvertEvent(Event);
     ConvertEvent(Event);
   case Event.What of
   case Event.What of
@@ -1380,6 +1383,8 @@ begin
       end;
       end;
     evBroadcast :
     evBroadcast :
       case Event.Command of
       case Event.Command of
+        cmUpdate :
+          Update;
         cmClearLineHighlights :
         cmClearLineHighlights :
           SetHighlightRow(-1);
           SetHighlightRow(-1);
         cmScrollBarChanged:
         cmScrollBarChanged:
@@ -1392,6 +1397,15 @@ begin
       end;
       end;
   end;
   end;
   inherited HandleEvent(Event);
   inherited HandleEvent(Event);
+  CurEvent:=nil;
+end;
+
+procedure TCodeEditor.Update;
+begin
+  LimitsChanged;
+  SelectionChanged; HighlightChanged;
+  UpdateIndicator;
+  DrawView;
 end;
 end;
 
 
 function TCodeEditor.GetLocalMenu: PMenu;
 function TCodeEditor.GetLocalMenu: PMenu;
@@ -2340,6 +2354,7 @@ var LineDelta, LineCount, CurLine: Sw_integer;
 begin
 begin
   if IsReadOnly then Exit;
   if IsReadOnly then Exit;
   if (SelStart.X=SelEnd.X) and (SelStart.Y=SelEnd.Y) then Exit;
   if (SelStart.X=SelEnd.X) and (SelStart.Y=SelEnd.Y) then Exit;
+  Lock;
   LineCount:=(SelEnd.Y-SelStart.Y)+1;
   LineCount:=(SelEnd.Y-SelStart.Y)+1;
   LineDelta:=0; LastX:=CurPos.X;
   LineDelta:=0; LastX:=CurPos.X;
   CurLine:=SelStart.Y;
   CurLine:=SelStart.Y;
@@ -2376,11 +2391,13 @@ begin
   DrawLines(CurPos.Y);
   DrawLines(CurPos.Y);
   Modified:=true;
   Modified:=true;
   UpdateIndicator;
   UpdateIndicator;
+  UnLock;
 end;
 end;
 
 
 procedure TCodeEditor.HideSelect;
 procedure TCodeEditor.HideSelect;
 begin
 begin
   SetSelection(CurPos,CurPos);
   SetSelection(CurPos,CurPos);
+  DrawLines(Delta.Y);
 end;
 end;
 
 
 procedure TCodeEditor.CopyBlock;
 procedure TCodeEditor.CopyBlock;
@@ -2901,9 +2918,14 @@ end;
   because GetShitState tells to extend the
   because GetShitState tells to extend the
   selection which gives wrong results (PM) }
   selection which gives wrong results (PM) }
 
 
-function ShouldExtend : boolean;
+function TCodeEditor.ShouldExtend: boolean;
+var ShiftInEvent: boolean;
 begin
 begin
-  ShouldExtend:=((GetShiftState and kbShift)<>0) and
+  ShiftInEvent:=false;
+  if Assigned(CurEvent) then
+    if CurEvent^.What=evKeyDown then
+      ShiftInEvent:=((CurEvent^.KeyShift and kbShift)<>0);
+  ShouldExtend:=ShiftInEvent and
     not DontConsiderShiftState;
     not DontConsiderShiftState;
 end;
 end;
 
 
@@ -2988,7 +3010,9 @@ var
 
 
   var MatchedSymbol: boolean;
   var MatchedSymbol: boolean;
       MatchingSymbol: string;
       MatchingSymbol: string;
-  function MatchesAnySpecSymbol(What: string; SClass: TSpecSymbolClass; PartialMatch, CaseInsensitive: boolean): boolean;
+  type TPartialType = (pmNone,pmLeft,pmRight,pmAny);
+  function MatchesAnySpecSymbol(What: string; SClass: TSpecSymbolClass; PartialMatch: TPartialType;
+           CaseInsensitive: boolean): boolean;
   var S: string;
   var S: string;
       I: Sw_integer;
       I: Sw_integer;
       Match,Found: boolean;
       Match,Found: boolean;
@@ -3001,12 +3025,25 @@ var
     begin
     begin
       SymbolIndex:=I;
       SymbolIndex:=I;
       S:=GetSpecSymbol(SClass,I-1);
       S:=GetSpecSymbol(SClass,I-1);
-      if CaseInsensitive then
-        S:=UpcaseStr(S);
-      if PartialMatch then Match:=MatchSymbol(What,S)
-            else Match:=What=S;
+      if (length(What)<length(S)) or
+         ((PartialMatch=pmNone) and (length(S)<>length(What)))
+          then
+        Match:=false
+      else
+        begin
+          if CaseInsensitive then
+            S:=UpcaseStr(S);
+          case PartialMatch of
+            pmNone : Match:=What=S;
+            pmRight:
+              Match:=copy(What,length(What)-length(S)+1,length(S))=S;
+          else Match:=MatchSymbol(What,S);
+          end;
+        end;
       if Match then
       if Match then
-    begin MatchingSymbol:=S; Found:=true; Break; end;
+      begin
+        MatchingSymbol:=S; Found:=true; Break;
+      end;
     end;
     end;
     MatchedSymbol:=MatchedSymbol or Found;
     MatchedSymbol:=MatchedSymbol or Found;
     MatchesAnySpecSymbol:=Found;
     MatchesAnySpecSymbol:=Found;
@@ -3014,48 +3051,48 @@ var
 
 
   function IsCommentPrefix: boolean;
   function IsCommentPrefix: boolean;
   begin
   begin
-    IsCommentPrefix:=MatchesAnySpecSymbol(SymbolConcat,ssCommentPrefix,true,false);
+    IsCommentPrefix:=MatchesAnySpecSymbol(SymbolConcat,ssCommentPrefix,pmLeft,false);
   end;
   end;
 
 
   function IsSingleLineCommentPrefix: boolean;
   function IsSingleLineCommentPrefix: boolean;
   begin
   begin
-    IsSingleLineCommentPrefix:=MatchesAnySpecSymbol(SymbolConcat,ssCommentSingleLinePrefix,true,false);
+    IsSingleLineCommentPrefix:=MatchesAnySpecSymbol(SymbolConcat,ssCommentSingleLinePrefix,pmLeft,false);
   end;
   end;
 
 
   function IsCommentSuffix: boolean;
   function IsCommentSuffix: boolean;
   begin
   begin
-    IsCommentSuffix:=(MatchesAnySpecSymbol(SymbolConcat,ssCommentSuffix,true,false))
+    IsCommentSuffix:=(MatchesAnySpecSymbol(SymbolConcat,ssCommentSuffix,pmRight,false))
       and (CurrentCommentType=SymbolIndex);
       and (CurrentCommentType=SymbolIndex);
   end;
   end;
 
 
   function IsStringPrefix: boolean;
   function IsStringPrefix: boolean;
   begin
   begin
-    IsStringPrefix:=MatchesAnySpecSymbol(SymbolConcat,ssStringPrefix,true,false);
+    IsStringPrefix:=MatchesAnySpecSymbol(SymbolConcat,ssStringPrefix,pmLeft,false);
   end;
   end;
 
 
   function IsStringSuffix: boolean;
   function IsStringSuffix: boolean;
   begin
   begin
-    IsStringSuffix:=MatchesAnySpecSymbol(SymbolConcat,ssStringSuffix,true,false);
+    IsStringSuffix:=MatchesAnySpecSymbol(SymbolConcat,ssStringSuffix,pmRight,false);
   end;
   end;
 
 
   function IsDirectivePrefix: boolean;
   function IsDirectivePrefix: boolean;
   begin
   begin
-    IsDirectivePrefix:=MatchesAnySpecSymbol(SymbolConcat,ssDirectivePrefix,true,false);
+    IsDirectivePrefix:=MatchesAnySpecSymbol(SymbolConcat,ssDirectivePrefix,pmLeft,false);
   end;
   end;
 
 
   function IsDirectiveSuffix: boolean;
   function IsDirectiveSuffix: boolean;
   begin
   begin
-    IsDirectiveSuffix:=MatchesAnySpecSymbol(SymbolConcat,ssDirectiveSuffix,true,false);
+    IsDirectiveSuffix:=MatchesAnySpecSymbol(SymbolConcat,ssDirectiveSuffix,pmRight,false);
   end;
   end;
 
 
   function IsAsmPrefix(const WordS: string): boolean;
   function IsAsmPrefix(const WordS: string): boolean;
   begin
   begin
-    IsAsmPrefix:=MatchesAnySpecSymbol(WordS,ssAsmPrefix,false,true);
+    IsAsmPrefix:=MatchesAnySpecSymbol(WordS,ssAsmPrefix,pmNone,true);
   end;
   end;
 
 
   function IsAsmSuffix(const WordS: string): boolean;
   function IsAsmSuffix(const WordS: string): boolean;
   begin
   begin
-    IsAsmSuffix:=MatchesAnySpecSymbol(WordS,ssAsmSuffix,false,true);
+    IsAsmSuffix:=MatchesAnySpecSymbol(WordS,ssAsmSuffix,pmNone,true);
   end;
   end;
 
 
   function GetCharClass(C: char): TCharClass;
   function GetCharClass(C: char): TCharClass;
@@ -3263,6 +3300,7 @@ end;
 
 
 procedure TCodeEditor.DrawLines(FirstLine: sw_integer);
 procedure TCodeEditor.DrawLines(FirstLine: sw_integer);
 begin
 begin
+  if FirstLine>=(Delta.Y+Size.Y) then Exit; { falls outside of the screen }
   DrawView;
   DrawView;
 end;
 end;
 
 
@@ -3409,6 +3447,12 @@ end;
 procedure TCodeEditor.SelectionChanged;
 procedure TCodeEditor.SelectionChanged;
 var Enable,CanPaste: boolean;
 var Enable,CanPaste: boolean;
 begin
 begin
+  if SelEnd.Y>GetLineCount-1 then
+    begin
+      SelEnd.Y:=GetLineCount-1;
+      SelEnd.X:=length(GetDisplayText(SelEnd.Y));
+    end;
+
   Enable:=((SelStart.X<>SelEnd.X) or (SelStart.Y<>SelEnd.Y)) and (Clipboard<>nil);
   Enable:=((SelStart.X<>SelEnd.X) or (SelStart.Y<>SelEnd.Y)) and (Clipboard<>nil);
   SetCmdState(ToClipCmds,Enable and (Clipboard<>@Self));
   SetCmdState(ToClipCmds,Enable and (Clipboard<>@Self));
   SetCmdState(NulClipCmds,Enable);
   SetCmdState(NulClipCmds,Enable);
@@ -3437,6 +3481,8 @@ begin
 end;
 end;
 
 
 constructor TCodeEditor.Load(var S: TStream);
 constructor TCodeEditor.Load(var S: TStream);
+var TS: PSubStream;
+    TSize: longint;
 begin
 begin
   inherited Load(S);
   inherited Load(S);
 
 
@@ -3446,6 +3492,17 @@ begin
   Lines^.Insert(NewLine(''));
   Lines^.Insert(NewLine(''));
 
 
   GetPeerViewPtr(S,Indicator);
   GetPeerViewPtr(S,Indicator);
+  S.Read(Flags,SizeOf(Flags));
+  S.Read(TabSize,SizeOf(TabSize));
+
+  if (Flags and efStoreContent)<>0 then
+    begin
+      S.Read(TSize,SizeOf(TSize));
+      New(TS, Init(@S,S.GetPos,TSize));
+      LoadFromStream(TS);
+      Dispose(TS, Done);
+    end;
+
   S.Read(SelStart,SizeOf(SelStart));
   S.Read(SelStart,SizeOf(SelStart));
   S.Read(SelEnd,SizeOf(SelEnd));
   S.Read(SelEnd,SizeOf(SelEnd));
   S.Read(Highlight,SizeOf(Highlight));
   S.Read(Highlight,SizeOf(Highlight));
@@ -3453,17 +3510,34 @@ begin
   S.Read(StoreUndo,SizeOf(StoreUndo));
   S.Read(StoreUndo,SizeOf(StoreUndo));
   S.Read(IsReadOnly,SizeOf(IsReadOnly));
   S.Read(IsReadOnly,SizeOf(IsReadOnly));
   S.Read(NoSelect,SizeOf(NoSelect));
   S.Read(NoSelect,SizeOf(NoSelect));
-  S.Read(Flags,SizeOf(Flags));
-  S.Read(TabSize,SizeOf(TabSize));
   S.Read(HighlightRow,SizeOf(HighlightRow));
   S.Read(HighlightRow,SizeOf(HighlightRow));
 
 
-  UpdateIndicator; LimitsChanged;
+  LimitsChanged;
+  SelectionChanged; HighlightChanged;
+  UpdateIndicator;
 end;
 end;
 
 
 procedure TCodeEditor.Store(var S: TStream);
 procedure TCodeEditor.Store(var S: TStream);
+var NS: TNulStream;
+    TSize: longint;
 begin
 begin
   inherited Store(S);
   inherited Store(S);
+
   PutPeerViewPtr(S,Indicator);
   PutPeerViewPtr(S,Indicator);
+  S.Write(Flags,SizeOf(Flags));
+  S.Write(TabSize,SizeOf(TabSize));
+
+  if (Flags and efStoreContent)<>0 then
+    begin
+      NS.Init;
+      SaveToStream(@NS);
+      TSize:=NS.GetSize;
+      NS.Done;
+
+      S.Write(TSize,SizeOf(TSize));
+      SaveToStream(@S);
+    end;
+
   S.Write(SelStart,SizeOf(SelStart));
   S.Write(SelStart,SizeOf(SelStart));
   S.Write(SelEnd,SizeOf(SelEnd));
   S.Write(SelEnd,SizeOf(SelEnd));
   S.Write(Highlight,SizeOf(Highlight));
   S.Write(Highlight,SizeOf(Highlight));
@@ -3471,11 +3545,55 @@ begin
   S.Write(StoreUndo,SizeOf(StoreUndo));
   S.Write(StoreUndo,SizeOf(StoreUndo));
   S.Write(IsReadOnly,SizeOf(IsReadOnly));
   S.Write(IsReadOnly,SizeOf(IsReadOnly));
   S.Write(NoSelect,SizeOf(NoSelect));
   S.Write(NoSelect,SizeOf(NoSelect));
-  S.Write(Flags,SizeOf(Flags));
-  S.Write(TabSize,SizeOf(TabSize));
   S.Write(HighlightRow,SizeOf(HighlightRow));
   S.Write(HighlightRow,SizeOf(HighlightRow));
 end;
 end;
 
 
+function TCodeEditor.LoadFromStream(Stream: PStream): boolean;
+var S: string;
+    OK: boolean;
+    Line: Sw_integer;
+begin
+  DeleteAllLines;
+  OK:=(Stream^.Status=stOK);
+  if eofstream(Stream) then
+   AddLine('')
+  else
+   while OK and (eofstream(Stream)=false) and (GetLineCount<MaxLineCount) do
+   begin
+     readlnfromstream(Stream,S);
+     OK:=OK and (Stream^.Status=stOK);
+     if OK then AddLine(S);
+   end;
+  LimitsChanged;
+  if (Flags and efSyntaxHighlight)<>0 then
+    UpdateAttrsRange(0,GetLineCount-1,attrAll+attrForceFull);
+  TextStart;
+  LoadFromStream:=OK;
+end;
+
+function TCodeEditor.SaveToStream(Stream: PStream): boolean;
+var S: string;
+    OK: boolean;
+    Line: Sw_integer;
+    P: PLine;
+    EOL: string[2];
+begin
+  {$ifdef Linux}EOL:=#10;{$else}EOL:=#13#10;{$endif}
+  OK:=(Stream^.Status=stOK); Line:=0;
+  while OK and (Line<GetLineCount) do
+  begin
+    P:=Lines^.At(Line);
+    if P^.Text=nil then S:='' else S:=P^.Text^;
+    if (Flags and efUseTabCharacters)<>0 then
+      S:=CompressUsingTabs(S,TabSize);
+    Stream^.Write(S[1],length(S));
+    Stream^.Write(EOL[1],length(EOL));
+    Inc(Line);
+    OK:=OK and (Stream^.Status=stOK);
+  end;
+  SaveToStream:=OK;
+end;
+
 destructor TCodeEditor.Done;
 destructor TCodeEditor.Done;
 begin
 begin
   inherited Done;
   inherited Done;
@@ -3500,7 +3618,7 @@ begin
   Message(@Self,evBroadcast,cmFileNameChanged,@Self);
   Message(@Self,evBroadcast,cmFileNameChanged,@Self);
 end;
 end;
 
 
-function TFileEditor.LoadFile: boolean;
+(*function TFileEditor.LoadFile: boolean;
 var S: string;
 var S: string;
     OK: boolean;
     OK: boolean;
     f: text;
     f: text;
@@ -3510,6 +3628,7 @@ begin
   DeleteAllLines;
   DeleteAllLines;
   GetMem(Buf,EditorTextBufSize);
   GetMem(Buf,EditorTextBufSize);
 {$I-}
 {$I-}
+  EatIO;
   FM:=FileMode; FileMode:=0;
   FM:=FileMode; FileMode:=0;
   Assign(f,FileName);
   Assign(f,FileName);
   SetTextBuf(f,Buf^,EditorTextBufSize);
   SetTextBuf(f,Buf^,EditorTextBufSize);
@@ -3529,25 +3648,31 @@ begin
   EatIO;
   EatIO;
 {$I+}
 {$I+}
   LimitsChanged;
   LimitsChanged;
-  Line:=-1;
-  repeat
-    Line:=UpdateAttrs(Line+1,attrAll+attrForceFull);
-  until Line>=GetLineCount-1;
+  if (Flags and efSyntaxHighlight)<>0 then
+    UpdateAttrsRange(0,GetLineCount-1,attrAll+attrForceFull);
   TextStart;
   TextStart;
   LoadFile:=OK;
   LoadFile:=OK;
   FreeMem(Buf,EditorTextBufSize);
   FreeMem(Buf,EditorTextBufSize);
+end;*)
+
+function TFileEditor.LoadFile: boolean;
+var S: PBufStream;
+    OK: boolean;
+begin
+  New(S, Init(FileName,stOpenRead,EditorTextBufSize));
+  OK:=Assigned(S);
+  if OK then OK:=LoadFromStream(S);
+  if Assigned(S) then Dispose(S, Done);
+
+  LoadFile:=OK;
 end;
 end;
 
 
 function TFileEditor.SaveFile: boolean;
 function TFileEditor.SaveFile: boolean;
-var S: string;
-    OK: boolean;
-    f: text;
-    Line: Sw_integer;
-    P: PLine;
+var OK: boolean;
     BAKName: string;
     BAKName: string;
-    Buf : Pointer;
+    S: PBufStream;
+    f: text;
 begin
 begin
-  GetMem(Buf,EditorTextBufSize);
 {$I-}
 {$I-}
   if (Flags and efBackupFiles)<>0 then
   if (Flags and efBackupFiles)<>0 then
   begin
   begin
@@ -3559,26 +3684,13 @@ begin
      Rename(F,BAKName);
      Rename(F,BAKName);
      EatIO;
      EatIO;
   end;
   end;
-  Assign(f,FileName);
-  Rewrite(f);
-  SetTextBuf(f,Buf^,EditorTextBufSize);
-  OK:=(IOResult=0); Line:=0;
-  while OK and (Line<GetLineCount) do
-  begin
-    P:=Lines^.At(Line);
-    if P^.Text=nil then S:='' else S:=P^.Text^;
-    if (Flags and efUseTabCharacters)<>0 then
-      S:=CompressUsingTabs(S,TabSize);
-    writeln(f,S);
-    Inc(Line);
-    OK:=OK and (IOResult=0);
-  end;
-  Close(F);
-  EatIO;
 {$I+}
 {$I+}
+  New(S, Init(FileName,stCreate,EditorTextBufSize));
+  OK:=Assigned(S);
+  if OK then OK:=SaveToStream(S);
+  if Assigned(S) then Dispose(S, Done);
   if OK then begin Modified:=false; UpdateIndicator; end;
   if OK then begin Modified:=false; UpdateIndicator; end;
   SaveFile:=OK;
   SaveFile:=OK;
-  FreeMem(Buf,EditorTextBufSize);
 end;
 end;
 
 
 function TFileEditor.ShouldSave: boolean;
 function TFileEditor.ShouldSave: boolean;
@@ -3661,6 +3773,8 @@ end;
 
 
 constructor TFileEditor.Load(var S: TStream);
 constructor TFileEditor.Load(var S: TStream);
 var P: PString;
 var P: PString;
+    SSP,SEP,CP,DP: TPoint;
+    HR: TRect;
 begin
 begin
   inherited Load(S);
   inherited Load(S);
   P:=S.ReadStr;
   P:=S.ReadStr;
@@ -3668,7 +3782,23 @@ begin
   if P<>nil then DisposeStr(P);
   if P<>nil then DisposeStr(P);
 
 
   UpdateIndicator;
   UpdateIndicator;
-  Message(@Self,evBroadcast,cmFileNameChanged,@Self);
+{  Message(@Self,evBroadcast,cmFileNameChanged,@Self);}
+
+  SSP:=SelStart; SEP:=SelEnd;
+  CP:=CurPos;
+  HR:=Highlight;
+  DP:=Delta;
+
+  if FileName<>'' then
+    LoadFile;
+
+  SetHighlight(HR.A,HR.B);
+  SetSelection(SSP,SEP);
+  SetCurPtr(CP.X,CP.Y);
+  ScrollTo(DP.X,DP.Y);
+  Modified:=false;
+
+  LimitsChanged; UpdateIndicator;
 end;
 end;
 
 
 procedure TFileEditor.Store(var S: TStream);
 procedure TFileEditor.Store(var S: TStream);
@@ -3677,7 +3807,6 @@ begin
   S.WriteStr(@FileName);
   S.WriteStr(@FileName);
 end;
 end;
 
 
-
 function CreateFindDialog: PDialog;
 function CreateFindDialog: PDialog;
 var R,R1,R2: TRect;
 var R,R1,R2: TRect;
     D: PDialog;
     D: PDialog;
@@ -3959,7 +4088,29 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.39  1999-07-28 23:11:26  peter
+  Revision 1.40  1999-08-03 20:22:42  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.39  1999/07/28 23:11:26  peter
     * fixes from gabor
     * fixes from gabor
 
 
   Revision 1.38  1999/07/12 13:14:24  pierre
   Revision 1.38  1999/07/12 13:14:24  pierre

+ 8 - 2
ide/text/whtmlhlp.pas

@@ -108,10 +108,16 @@ const
 
 
 function FormatPath(Path: string): string;
 function FormatPath(Path: string): string;
 var P: sw_integer;
 var P: sw_integer;
+    SC: char;
 begin
 begin
+  if DirSep='/' then
+    SC:='\'
+  else
+    SC:='/';
+
   repeat
   repeat
-    if DirSep='/' then P:=Pos('\',Path)
-                  else P:=Pos('/',Path);
+    P:=Pos(SC,Path);
+    if Path[P]<>SC then P:=0;
     if P>0 then Path[P]:=DirSep;
     if P>0 then Path[P]:=DirSep;
   until P=0;
   until P=0;
   FormatPath:=Path;
   FormatPath:=Path;

+ 101 - 2
ide/text/wresourc.pas

@@ -114,6 +114,8 @@ type
                    var Source: TStream; ADataSize: longint): boolean; virtual;
                    var Source: TStream; ADataSize: longint): boolean; virtual;
        function    DeleteResourceEntry(const ResName: string; ALangID: longint): boolean; virtual;
        function    DeleteResourceEntry(const ResName: string; ALangID: longint): boolean; virtual;
        function    DeleteResource(const ResName: string): boolean; virtual;
        function    DeleteResource(const ResName: string): boolean; virtual;
+       function    ReadResourceEntry(const ResName: string; ALangID: longint; var Buf; var BufSize: sw_word): boolean;
+       function    ReadResourceEntryToStream(const ResName: string; ALangID: longint; var DestS: TStream): boolean;
        procedure   Flush; virtual;
        procedure   Flush; virtual;
        destructor  Done; virtual;
        destructor  Done; virtual;
      public
      public
@@ -322,6 +324,7 @@ begin
     Modified:=true
     Modified:=true
   else
   else
     begin
     begin
+      S^.Reset;
       BaseOfs:=S^.GetPos;
       BaseOfs:=S^.GetPos;
       S^.Read(Header,SizeOf(Header));
       S^.Read(Header,SizeOf(Header));
       OK:=(S^.Status=stOK) and
       OK:=(S^.Status=stOK) and
@@ -431,6 +434,7 @@ begin
       AddResEntryPtr(P,E);
       AddResEntryPtr(P,E);
       UpdateBlockDatas;
       UpdateBlockDatas;
       RemSize:=ADataSize; CurOfs:=0;
       RemSize:=ADataSize; CurOfs:=0;
+      S^.Reset;
       S^.Seek(BaseOfs+E^.DataOfs);
       S^.Seek(BaseOfs+E^.DataOfs);
       while (RemSize>0) do
       while (RemSize>0) do
       begin
       begin
@@ -463,6 +467,7 @@ begin
       UpdateBlockDatas;
       UpdateBlockDatas;
       GetMem(Buf,BufSize);
       GetMem(Buf,BufSize);
       RemSize:=ADataSize;
       RemSize:=ADataSize;
+      S^.Reset;
       S^.Seek(BaseOfs+E^.DataOfs);
       S^.Seek(BaseOfs+E^.DataOfs);
       while (RemSize>0) do
       while (RemSize>0) do
       begin
       begin
@@ -515,6 +520,78 @@ begin
   DeleteResource:=OK;
   DeleteResource:=OK;
 end;
 end;
 
 
+function TResourceFile.ReadResourceEntry(const ResName: string; ALangID: longint; var Buf; var BufSize: sw_word): boolean;
+var E: PResourceEntry;
+    P: PResource;
+    OK: boolean;
+    CurOfs,CurFrag: sw_word;
+    TempBuf: pointer;
+const TempBufSize = 4096;
+begin
+  P:=FindResource(ResName);
+  OK:=P<>nil;
+  if OK then E:=P^.Items^.SearchEntryForLang(ALangID);
+  OK:=OK and (E<>nil);
+  OK:=OK and (E^.DataLen<=BufSize);
+  if OK then
+    begin
+      GetMem(TempBuf,TempBufSize);
+      S^.Reset;
+      S^.Seek(BaseOfs+E^.DataOfs);
+      OK:=(S^.Status=stOK);
+      CurOfs:=0;
+
+      while OK and (CurOfs<E^.DataLen) do
+      begin
+        CurFrag:=Min(E^.DataLen-CurOfs,TempBufSize);
+        S^.Read(TempBuf^,CurFrag);
+        OK:=OK and (S^.Status=stOK);
+        if OK then
+          Move(TempBuf^,PByteArray(@Buf)^[CurOfs],CurFrag);
+        Inc(CurOfs,CurFrag);
+      end;
+
+      FreeMem(TempBuf,TempBufSize);
+    end;
+  ReadResourceEntry:=OK;
+end;
+
+function TResourceFile.ReadResourceEntryToStream(const ResName: string; ALangID: longint; var DestS: TStream): boolean;
+var E: PResourceEntry;
+    P: PResource;
+    OK: boolean;
+    CurOfs,CurFrag: sw_word;
+    TempBuf: pointer;
+const TempBufSize = 4096;
+begin
+  P:=FindResource(ResName);
+  OK:=P<>nil;
+  if OK then E:=P^.Items^.SearchEntryForLang(ALangID);
+  OK:=OK and (E<>nil);
+  if OK then
+    begin
+      GetMem(TempBuf,TempBufSize);
+      S^.Reset;
+      S^.Seek(BaseOfs+E^.DataOfs);
+      OK:=(S^.Status=stOK);
+      CurOfs:=0;
+
+      while OK and (CurOfs<E^.DataLen) do
+      begin
+        CurFrag:=Min(E^.DataLen-CurOfs,TempBufSize);
+        S^.Read(TempBuf^,CurFrag);
+        OK:=OK and (S^.Status=stOK);
+        if OK then
+          DestS.Write(TempBuf^,CurFrag);
+        OK:=OK and (DestS.Status=stOK);
+        Inc(CurOfs,CurFrag);
+      end;
+
+      FreeMem(TempBuf,TempBufSize);
+    end;
+  ReadResourceEntryToStream:=OK;
+end;
+
 function TResourceFile.FindResource(const ResName: string): PResource;
 function TResourceFile.FindResource(const ResName: string): PResource;
 begin
 begin
   FindResource:=Resources^.SearchResourceByName(ResName);
   FindResource:=Resources^.SearchResourceByName(ResName);
@@ -691,7 +768,7 @@ end;
 constructor TResourceFile.LoadFile(AFileName: string);
 constructor TResourceFile.LoadFile(AFileName: string);
 var B: PBufStream;
 var B: PBufStream;
 begin
 begin
-  New(B, Init(AFileName, stCreate, 4096));
+  New(B, Init(AFileName, stOpen, 4096));
   if (B<>nil) and (B^.Status<>stOK) then
   if (B<>nil) and (B^.Status<>stOK) then
     begin Dispose(B, Done); B:=nil; end;
     begin Dispose(B, Done); B:=nil; end;
   if B=nil then Fail;
   if B=nil then Fail;
@@ -703,7 +780,29 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.5  1999-06-17 23:45:21  pierre
+  Revision 1.6  1999-08-03 20:22:44  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.5  1999/06/17 23:45:21  pierre
    * dipsoe of S field in TResourceFile destructor
    * dipsoe of S field in TResourceFile destructor
 
 
   Revision 1.4  1999/04/07 21:56:05  peter
   Revision 1.4  1999/04/07 21:56:05  peter

+ 103 - 11
ide/text/wutils.pas

@@ -38,6 +38,16 @@ type
     procedure FreeItem(Item: Pointer); virtual;
     procedure FreeItem(Item: Pointer); virtual;
   end;
   end;
 
 
+  PNulStream = ^TNulStream;
+  TNulStream = object(TStream)
+    constructor Init;
+    function    GetPos: Longint; virtual;
+    function    GetSize: Longint; virtual;
+    procedure   Read(var Buf; Count: Word); virtual;
+    procedure   Seek(Pos: Longint); virtual;
+    procedure   Write(var Buf; Count: Word); virtual;
+  end;
+
   PSubStream = ^TSubStream;
   PSubStream = ^TSubStream;
   TSubStream = object(TStream)
   TSubStream = object(TStream)
     constructor Init(AStream: PStream; AStartPos, ASize: longint);
     constructor Init(AStream: PStream; AStartPos, ASize: longint);
@@ -48,7 +58,6 @@ type
     procedure   Write(var Buf; Count: Word); virtual;
     procedure   Write(var Buf; Count: Word); virtual;
   private
   private
     StartPos: longint;
     StartPos: longint;
-    Size    : longint;
     S       : PStream;
     S       : PStream;
   end;
   end;
 
 
@@ -56,6 +65,8 @@ type
   procedure readln(var t:text;var s:string);
   procedure readln(var t:text;var s:string);
 {$endif}
 {$endif}
 
 
+procedure readlnfromstream(Stream: PStream; var s:string);
+function eofstream(s: pstream): boolean;
 
 
 function Min(A,B: longint): longint;
 function Min(A,B: longint): longint;
 function Max(A,B: longint): longint;
 function Max(A,B: longint): longint;
@@ -119,6 +130,32 @@ uses
   end;
   end;
 {$endif}
 {$endif}
 
 
+function eofstream(s: pstream): boolean;
+begin
+  eofstream:=(s^.getpos>=s^.getsize);
+end;
+
+procedure readlnfromstream(Stream: PStream; var S:string);
+  var
+    c : char;
+    i : longint;
+  begin
+    c:=#0;
+    i:=0;
+    while (not eofstream(stream)) and (c<>#10) do
+     begin
+       stream^.read(c,sizeof(c));
+       if c<>#10 then
+        begin
+          inc(i);
+          s[i]:=c;
+        end;
+     end;
+    if (i>0) and (s[i]=#13) then
+      dec(i);
+    s[0]:=chr(i);
+  end;
+
 
 
 function Max(A,B: longint): longint;
 function Max(A,B: longint): longint;
 begin
 begin
@@ -303,23 +340,56 @@ begin
   if Item<>nil then DisposeStr(Item);
   if Item<>nil then DisposeStr(Item);
 end;
 end;
 
 
+constructor TNulStream.Init;
+begin
+  inherited Init;
+  Position:=0;
+end;
+
+function TNulStream.GetPos: Longint;
+begin
+  GetPos:=Position;
+end;
+
+function TNulStream.GetSize: Longint;
+begin
+  GetSize:=Position;
+end;
+
+procedure TNulStream.Read(var Buf; Count: Word);
+begin
+  Error(stReadError,0);
+end;
+
+procedure TNulStream.Seek(Pos: Longint);
+begin
+  if Pos<=Position then
+    Position:=Pos;
+end;
+
+procedure TNulStream.Write(var Buf; Count: Word);
+begin
+  Inc(Position,Count);
+end;
+
 constructor TSubStream.Init(AStream: PStream; AStartPos, ASize: longint);
 constructor TSubStream.Init(AStream: PStream; AStartPos, ASize: longint);
 begin
 begin
   inherited Init;
   inherited Init;
-  S:=AStream; StartPos:=AStartPos; Size:=ASize;
-  inherited Seek(StartPos);
+  if Assigned(AStream)=false then Fail;
+  S:=AStream; StartPos:=AStartPos; StreamSize:=ASize;
+  Seek(0);
 end;
 end;
 
 
 function TSubStream.GetPos: Longint;
 function TSubStream.GetPos: Longint;
 var Pos: longint;
 var Pos: longint;
 begin
 begin
-  Pos:=inherited GetPos; Dec(Pos,StartPos);
+  Pos:=S^.GetPos; Dec(Pos,StartPos);
   GetPos:=Pos;
   GetPos:=Pos;
 end;
 end;
 
 
 function TSubStream.GetSize: Longint;
 function TSubStream.GetSize: Longint;
 begin
 begin
-  GetSize:=Size;
+  GetSize:=StreamSize;
 end;
 end;
 
 
 procedure TSubStream.Read(var Buf; Count: Word);
 procedure TSubStream.Read(var Buf; Count: Word);
@@ -327,8 +397,8 @@ var Pos: longint;
     RCount: word;
     RCount: word;
 begin
 begin
   Pos:=GetPos;
   Pos:=GetPos;
-  if Pos+Count>Size then RCount:=Size-Pos else RCount:=Count;
-  inherited Read(Buf,RCount);
+  if Pos+Count>StreamSize then RCount:=StreamSize-Pos else RCount:=Count;
+  S^.Read(Buf,RCount);
   if RCount<Count then
   if RCount<Count then
     Error(stReadError,0);
     Error(stReadError,0);
 end;
 end;
@@ -336,19 +406,41 @@ end;
 procedure TSubStream.Seek(Pos: Longint);
 procedure TSubStream.Seek(Pos: Longint);
 var RPos: longint;
 var RPos: longint;
 begin
 begin
-  if (Pos<=Size) then RPos:=Pos else RPos:=Size;
-  inherited Seek(StartPos+RPos);
+  if (Pos<=StreamSize) then RPos:=Pos else RPos:=StreamSize;
+  S^.Seek(StartPos+RPos);
 end;
 end;
 
 
 procedure TSubStream.Write(var Buf; Count: Word);
 procedure TSubStream.Write(var Buf; Count: Word);
 begin
 begin
-  inherited Write(Buf,Count);
+  S^.Write(Buf,Count);
 end;
 end;
 
 
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1999-04-07 21:56:06  peter
+  Revision 1.5  1999-08-03 20:22:45  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.4  1999/04/07 21:56:06  peter
     + object support for browser
     + object support for browser
     * html help fixes
     * html help fixes
     * more desktop saving things
     * more desktop saving things

+ 29 - 2
ide/text/wviews.pas

@@ -172,6 +172,7 @@ type
 procedure InsertOK(ADialog: PDialog);
 procedure InsertOK(ADialog: PDialog);
 procedure InsertButtons(ADialog: PDialog);
 procedure InsertButtons(ADialog: PDialog);
 
 
+procedure Bug(const S: string; Params: pointer);
 procedure ErrorBox(const S: string; Params: pointer);
 procedure ErrorBox(const S: string; Params: pointer);
 procedure WarningBox(const S: string; Params: pointer);
 procedure WarningBox(const S: string; Params: pointer);
 procedure InformationBox(const S: string; Params: pointer);
 procedure InformationBox(const S: string; Params: pointer);
@@ -1299,7 +1300,7 @@ end;
 function TLocalMenuListBox.GetLocalMenu: PMenu;
 function TLocalMenuListBox.GetLocalMenu: PMenu;
 begin
 begin
   GetLocalMenu:=nil;
   GetLocalMenu:=nil;
-  Abstract;
+{  Abstract;}
 end;
 end;
 
 
 function TLocalMenuListBox.GetCommandTarget: PView;
 function TLocalMenuListBox.GetCommandTarget: PView;
@@ -1379,6 +1380,10 @@ begin
   end;
   end;
 end;
 end;
 
 
+procedure Bug(const S: string; Params: pointer);
+begin
+  ErrorBox('Bug check failed: '+S+#13+'Please report to author!',Params);
+end;
 
 
 procedure ErrorBox(const S: string; Params: pointer);
 procedure ErrorBox(const S: string; Params: pointer);
 begin
 begin
@@ -2074,7 +2079,29 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  1999-06-28 19:32:37  peter
+  Revision 1.10  1999-08-03 20:22:46  peter
+    + TTab acts now on Ctrl+Tab and Ctrl+Shift+Tab...
+    + Desktop saving should work now
+       - History saved
+       - Clipboard content saved
+       - Desktop saved
+       - Symbol info saved
+    * syntax-highlight bug fixed, which compared special keywords case sensitive
+      (for ex. 'asm' caused asm-highlighting, while 'ASM' didn't)
+    * with 'whole words only' set, the editor didn't found occourences of the
+      searched text, if the text appeared previously in the same line, but didn't
+      satisfied the 'whole-word' condition
+    * ^QB jumped to (SelStart.X,SelEnd.X) instead of (SelStart.X,SelStart.Y)
+      (ie. the beginning of the selection)
+    * when started typing in a new line, but not at the start (X=0) of it,
+      the editor inserted the text one character more to left as it should...
+    * TCodeEditor.HideSelection (Ctrl-K+H) didn't update the screen
+    * Shift shouldn't cause so much trouble in TCodeEditor now...
+    * Syntax highlight had problems recognizing a special symbol if it was
+      prefixed by another symbol character in the source text
+    * Auto-save also occours at Dos shell, Tool execution, etc. now...
+
+  Revision 1.9  1999/06/28 19:32:37  peter
     * fixes from gabor
     * fixes from gabor
 
 
   Revision 1.8  1999/06/28 12:29:56  pierre
   Revision 1.8  1999/06/28 12:29:56  pierre