ide; debugger; valgrind integration. gdb dialog command history. old valgrind launche...
[sdk] / ide / src / designer / CodeEditor.ec
index 9120c9a..41a49ab 100644 (file)
@@ -685,7 +685,7 @@ class CodeEditor : Window
 
    bool noParsing;
 
-   property bool parsing { get { return !noParsing && !ide.noParsing; } };
+   property bool parsing { get { return editBox.syntaxHighlighting && !noParsing && !ide.noParsing; } };
 
    void ProcessCaretMove(EditBox editBox, int line, int charPos)
    {
@@ -1521,7 +1521,8 @@ class CodeEditor : Window
       bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
       {
          CodeEditor editor = (CodeEditor)master;
-         if(!active)
+         Window rw = previous ? previous.rootWindow : null;
+         if(!active && rw != editor.paramsList)
          {
             Destroy(0);
             editor.membersListShown = false;
@@ -1596,7 +1597,8 @@ class CodeEditor : Window
       bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
       {
          CodeEditor editor = (CodeEditor)master;
-         if(!active)
+         Window rw = previous ? previous.rootWindow : null;
+         if(!active && previous != editor.editBox && rw != editor.membersList)
          {
             Destroy(0);
             editor.membersListShown = false;
@@ -1920,7 +1922,8 @@ class CodeEditor : Window
                CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
                ProjectConfig config = projectView.project.config;
                int bitDepth = ide.workspace.bitDepth;
-               ide.debugger.RunToCursor(compiler, config, bitDepth, fileName, line, false);
+               bool useValgrind = ide.workspace.useValgrind;
+               ide.debugger.RunToCursor(compiler, config, bitDepth, useValgrind, fileName, line, false, false);
                delete compiler;
             }
          }
@@ -1939,7 +1942,27 @@ class CodeEditor : Window
             CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
             ProjectConfig config = projectView.project.config;
             int bitDepth = ide.workspace.bitDepth;
-            ide.debugger.RunToCursor(compiler, config, bitDepth, fileName, line, true);
+            bool useValgrind = ide.workspace.useValgrind;
+            ide.debugger.RunToCursor(compiler, config, bitDepth, useValgrind, fileName, line, true, false);
+            delete compiler;
+         }
+         return true;
+      }
+   };
+   MenuItem debugSkipRunToCursorAtSameLevel
+   {
+      debugMenu, $"Run To Cursor At Same Level Skipping Breakpoints", u, Key { f10, alt = true };
+      bool NotifySelect(MenuItem selection, Modifiers mods)
+      {
+         ProjectView projectView = ide.projectView;
+         int line = editBox.lineNumber + 1;
+         if(projectView)
+         {
+            CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+            ProjectConfig config = projectView.project.config;
+            int bitDepth = ide.workspace.bitDepth;
+            bool useValgrind = ide.workspace.useValgrind;
+            ide.debugger.RunToCursor(compiler, config, bitDepth, useValgrind, fileName, line, true, true);
             delete compiler;
          }
          return true;
@@ -2365,16 +2388,20 @@ class CodeEditor : Window
       if(fileName)
       {
          GetExtension(fileName, ext);
+
+         if(!strcmpi(ext, "ec") || !strcmpi(ext, "eh") || !strcmpi(ext, "c") || !strcmpi(ext, "h") || !strcmpi(ext, "cpp") ||
+               !strcmpi(ext, "hpp") || !strcmpi(ext, "cxx") || !strcmpi(ext, "hxx") || !strcmpi(ext, "cc") || !strcmpi(ext, "hh") ||
+               !strcmpi(ext, "m") || !strcmpi(ext, "mm") || !strcmpi(ext, "cs") || !strcmpi(ext, "java") || !strcmpi(ext, "y") || !strcmpi(ext, "l"))
+            editBox.syntaxHighlighting = true;
+         else
+            editBox.syntaxHighlighting = false;
+
          if(parsing && !strcmpi(ext, "ec"))
          {
             codeModified = true;
             EnsureUpToDate();
          }
 
-         if(!strcmpi(ext, "ec") || !strcmpi(ext, "c") || !strcmpi(ext, "cc") || !strcmpi(ext, "cpp") || !strcmpi(ext, "eh") || !strcmpi(ext, "hh") || !strcmpi(ext, "hpp") || !strcmpi(ext, "h") || !strcmpi(ext, "hxx") || !strcmpi(ext, "cxx"))
-            editBox.syntaxHighlighting = true;
-         else
-            editBox.syntaxHighlighting = false;
          {
             int spaceW;
             display.FontExtent(font.font, " ", 1, &spaceW, null);
@@ -2423,6 +2450,7 @@ class CodeEditor : Window
    {
       debugRunToCursor.disabled                = unavailable || executing;
       debugSkipRunToCursor.disabled            = unavailable || executing;
+      debugSkipRunToCursorAtSameLevel.disabled = unavailable || executing;
       debugToggleBreakpoint.disabled           = bpNoToggle;
    }
 
@@ -4401,7 +4429,7 @@ class CodeEditor : Window
    {
       if(!this) return;
       if(!parsing) return;
-         
+
       updatingCode++;
       if(codeModified)
       {
@@ -5790,7 +5818,7 @@ class CodeEditor : Window
          for(link = (BTNamedLink)nameSpace.classes.first; link; link = (BTNamedLink)((BTNode)link).next)
          {
             Class _class = link.data;
-            if(_class.type != systemClass)
+            if(_class.type != systemClass && !_class.templateClass)  // Omit templatized classes
             {
                DataRow row = membersList.AddString(_class.name);
                row.icon = (_class.type == unitClass || _class.type == enumClass) ? icons[typeDataType] : icons[typeClass];
@@ -5890,7 +5918,8 @@ class CodeEditor : Window
       for(link = (BTNamedLink)nameSpace.classes.first; link; link = (BTNamedLink)((BTNode)link).next)
       {
          Class _class = link.data;
-         if(_class.type == enumClass && (dest.kind != classType || !dest._class || dest._class.registered != _class))
+         if(_class.type == enumClass && (dest.kind != classType || ((!dest._class || !dest._class.registered || (dest._class.registered != _class && strcmp(dest._class.registered.dataTypeString, "char *"))) && !dest.classObjectType)) &&
+            dest.kind != pointerType && dest.kind != ellipsisType)
          {
             OldList conversions { };
             Type type { };