Index: cDebuggerEngine.pkg
===================================================================
--- cDebuggerEngine.pkg	(revision 63)
+++ cDebuggerEngine.pkg	(revision 64)
@@ -119,8 +119,8 @@
     Forward Get Msg_Entering To Rval  // Do Normal Entering
     // if entering is ok and single item check shadow state of that item.
     If (Rval=0) Begin
-      Get Item_Count To iCount
-      Get Current_Item To iItem
+//      Get Item_Count To iCount
+//      Get Current_Item To iItem
 //      Showln ("entering stack "+trim(iCount)*"current"*trim(iItem))
       //  Get Shadow_State Item 0 To Rval
     End
@@ -279,8 +279,11 @@
     Property Boolean        pbEngineActive        False
     Property Boolean pbProgramStarted      False
     Property Boolean pbProgramPaused       False
+    Property Boolean pbLimitedBreakMode    False
+    Property Boolean pbDebugRestart        False
     Property String[]       pAllMessages
     Property String[]       pAllProperties
+    Property String[]       pLanguageKeywords
     Property tBreakPoints[] pBreakPoints
     
     Set Name To "oDebuggerEngine"
@@ -367,6 +370,28 @@
     Set pAllProperties to AllProperties
   End_Procedure
   
+  Function IsLanguageKeyword String sKeyword Returns Boolean
+    Boolean  bIsKeyword
+    Integer  iCount
+    Integer  iKeyword
+    String[] Keywords
+    
+    Move false to bIsKeyword
+    Move (lowercase(sKeyWord)) To sKeyword
+    If (sKeyword<>"") Begin
+      Get pLanguageKeywords To Keywords
+      Move (SizeOfArray(Keywords)) To iCount
+      Decrement iCount
+      For iKeyWord From 0 To iCount
+        If (Keywords[iKeyword]=sKeyword) Begin
+          Move True To bIsKeyword
+          Move iCount To iKeyword // stop
+        End
+      Loop
+    End
+    Function_Return bIsKeyword
+  End_Function
+  
   Function IsVariableProperty String sVariable Returns Boolean
     Integer  iCount
     Integer  iProp
@@ -753,22 +778,28 @@
   // Occurs after the program exits
   Procedure OnComProgramExit
     Boolean  bStartedFromCLI
-    String[] AllMessages
-    String[] AllProperties
+    Boolean  bRestartMode
+    String[] Empty
     Set pbProgramStarted To False
     Set pbProgramPaused  To False
     Send SaveBreakPointsToDisk
     Set ApplicationFileName To ""
-    Move (ResizeArray(Allmessages,0))   To AllMessages
-    Move (ResizeArray(AllProperties,0)) To AllProperties
-    Set pAllMessages   to AllMessages
-    Set pAllProperties to AllProperties
-    Get pbStartedFromCLI of ghoApplication To bStartedFromCLI
-    If (bStartedFromCli) Begin
-      // debug session was started from the command line.
-      // Stopping the debug session normally should stop the debugger as well.
-      Send Exit_Application
+    Move (ResizeArray(Empty,0))   To Empty
+    Set pAllMessages      To Empty
+    Set pAllProperties    To Empty
+    Set pLanguageKeywords To Empty
+    Get pbDebugRestart to bRestartMode
+    If (bRestartMode) Begin
+      Send DoDebugRun
     End
+    Else Begin
+      Get pbStartedFromCLI of ghoApplication To bStartedFromCLI
+      If (bStartedFromCli) Begin
+        // debug session was started from the command line.
+        // Stopping the debug session normally should stop the debugger as well.
+        Send Exit_Application
+      End
+    End
   End_Procedure
 
   // Occurs if there is an error starting the program
@@ -816,7 +847,7 @@
         Send SetDebuggerAsForegroundApp
       End
       Send doOpenSourceFileAtLine of hoEditor llfile llline
-      Send doActivateCallStack  // only displays if exists or not.
+      Send doActivateDebugPanels  // only displays if exists or not.
     End
   End_Procedure
   
@@ -823,13 +854,15 @@
   //
   // Occurs when the program execution is paused
   Procedure OnComProgramPaused String llfile UInteger llline Boolean lllimitedBreakMode
-    Set pbProgramPaused  To True
+    Set pbProgramPaused    To True
+    Set pbLimitedBreakMode To lllimitedBreakMode
     Send OnProgramPaused llfile llline lllimitedBreakMode
   End_Procedure
 
   // Occurs when the program execution resumes
   Procedure OnComProgramContinue
-    Set pbProgramPaused  To False
+    Set pbProgramPaused    To False
+    Set pbLimitedBreakMode To False
   End_Procedure
 
   // Occurs after a change requiring views to be refreshed
@@ -871,6 +904,29 @@
     //Send Info_box lldescription "WebApp FATAL Error"
     Showln lleventid lltext
   End_Procedure
+  
+  Procedure AddKeyword String sWord
+    Integer  iCount
+    String[] Keywords
+    
+    Get pLanguageKeywords To Keywords
+    Move (SizeOfArray(Keywords)) To iCount
+    Move (Lowercase(sWord)) To Keywords[iCount]
+    Set pLanguageKeywords To Keywords
+  End_Procedure
+  
+  // Language keywords are not evaluated in the tooltip
+  Procedure AddLanguageKeywords
+    Send AddKeyword "End_Function"
+    Send AddKeyword "End_Procedure"
+    Send AddKeyword "Function"
+    Send AddKeyword "Move"
+    Send AddKeyword "Procedure"
+    Send AddKeyword "Send"
+    Send AddKeyword "Showln"
+    Send AddKeyword "To"
+    Send AddKeyword "UChar[]"
+  End_Procedure
 
   
   Procedure doCreateCallStack
@@ -965,7 +1021,6 @@
       If (hoVariables) Begin
         Set phoLocalVariables  To hoVariables
         Set Name               Of hoVariables To "oLocalVariables"
-        Send CreateObjectCallback of hoParent hoVariables
         
         Send CreateComObject   Of hoVariables
         Get IsComObjectCreated Of hoVariables To bCreated
@@ -972,6 +1027,7 @@
         If (bCreated) Begin
           Set ComWindowType Of hoVariables To 0 // locals
         End
+        Send CreateObjectCallback of hoParent hoVariables
       End
     End
   End_Procedure // doCreateLocalVariables
@@ -996,9 +1052,11 @@
   End_Procedure // doCreateTables
 
 
-  
-  Procedure doActivateCallStack
+  // we MUST send activate to the debug panels to make them display.
+  Procedure doActivateDebugPanels
     Handle  hoCallStack
+    Handle  hoLocalVars
+    Handle  hoGlobalVars
     Boolean bCreated
 
     Get phoCallStack To hoCallStack
@@ -1005,12 +1063,28 @@
     If (hoCallStack) Begin
       Get IsComObjectCreated Of hoCallStack To bCreated
       If (bCreated) Begin
-        Send Activate of hoCallStack  // we MUST send activate to the callstack to make it display itself
+        Send Activate of hoCallStack
       End
     End
-  End_Procedure // doActivateCallStack
 
+    Get phoLocalVariables To hoLocalVars
+    If (hoLocalVars) Begin
+      Get IsComObjectCreated Of hoLocalVars To bCreated
+      If (bCreated) Begin
+        Send Activate of hoLocalVars
+      End
+    End
 
+    Get phoGlobalVariables To hoGlobalVars
+    If (hoGlobalVars) Begin
+      Get IsComObjectCreated Of hoGlobalVars To bCreated
+      If (bCreated) Begin
+        Send Activate of hoGlobalVars
+      End
+    End
+  End_Procedure
+
+
   
   Procedure DoCreateEngine
     Boolean bCreated
@@ -1037,6 +1111,8 @@
     Send doCreateLocalVariables
     
     Send doCreateTablesWindow
+    
+    Send AddLanguageKeywords
   End_Procedure // DoCreateEngine
 
   
