ide: Fixed various global settings issues
[sdk] / ide / src / project / ProjectView.ec
index 99eba00..c66acd3 100644 (file)
@@ -7,7 +7,7 @@ class ImportFolderFSI : NormalFileSystemIterator
    ProjectView projectView;
    Array<ProjectNode> stack { };
 
-   bool OnFolder(char * folderPath)
+   bool OnFolder(const char * folderPath)
    {
       char name[MAX_LOCATION];
       ProjectNode parentNode = stack.lastIterator.data;
@@ -20,12 +20,12 @@ class ImportFolderFSI : NormalFileSystemIterator
       return true;
    }
 
-   void OutFolder(char * folderPath, bool isRoot)
+   void OutFolder(const char * folderPath, bool isRoot)
    {
       stack.lastIterator.Remove(); //stack.Remove();
    }
 
-   bool OnFile(char * filePath)
+   bool OnFile(const char * filePath)
    {
       ProjectNode parentNode = stack.lastIterator.data;
       if(!projectView.AddFile(parentNode, filePath, parentNode.isInResources, false))
@@ -67,7 +67,7 @@ static Array<FileType> projectTypes
    { $"Ecere IDE Workspace", WorkspaceExtension }
 ] };
 
-static char * iconNames[] =
+static const char * iconNames[] =
 {
    "<:ecere>mimeTypes/file.png",                   /*genFile*/
    "<:ecere>mimeTypes/textEcereWorkspace.png",     /*ewsFile*/
@@ -103,6 +103,56 @@ enum BuildState
    property bool { get { return this != none; } }
    //property bool actualBuild { get { return this == buildingMainProject || this == buildingSecondaryProject;  } }
 };
+enum BuildOutputMode { normal, raw, verbose, justPrint }; // note: verbose and justPrint both imply raw output
+Array<const String> bldMnuStrBuild
+{[
+   $"Build",
+   $"Build (Raw Output)",
+   $"Build (Verbose)",
+   $"Build (Just Print Commands)"
+]};
+Array<const String> bldMnuStrRelink
+{[
+   $"Relink",
+   $"Relink (Raw Output)",
+   $"Relink (Verbose)",
+   $"Relink (Just Print Commands)"
+]};
+Array<const String> bldMnuStrRebuild
+{[
+   $"Rebuild",
+   $"Rebuild (Raw Output)",
+   $"Rebuild (Verbose)",
+   $"Rebuild (Just Print Commands)"
+]};
+Array<const String> bldMnuStrCleanTarget
+{[
+   $"Clean Target",
+   $"Clean Target (Raw Output)",
+   $"Clean Target (Verbose)",
+   $"Clean Target (Just Print Commands)"
+]};
+Array<const String> bldMnuStrClean
+{[
+   $"Clean",
+   $"Clean (Raw Output)",
+   $"Clean (Verbose)",
+   $"Clean (Just Print Commands)"
+]};
+Array<const String> bldMnuStrRealClean
+{[
+   $"Real Clean",
+   $"Real Clean (Raw Output)",
+   $"Real Clean (Verbose)",
+   $"Real Clean (Just Print Commands)"
+]};
+Array<const String> bldMnuStrCompile
+{[
+   $"Compile",
+   $"Compile (Raw Output)",
+   $"Compile (Verbose)",
+   $"Compile (Just Print Commands)"
+]};
 
 class ProjectView : Window
 {
@@ -216,7 +266,8 @@ class ProjectView : Window
          {
             bool showDebuggingMenuItems = mods.ctrl && mods.shift;
             bool showInstallMenuItem = mods.ctrl && mods.shift;
-            ProjectNode node = (ProjectNode)row.tag;
+            BuildOutputMode outputMode = (mods.ctrl && mods.shift) ? justPrint : mods.ctrl ? verbose : mods.shift ? raw : normal;
+            ProjectNode node = (ProjectNode)(intptr)row.tag;
 #ifdef IDE_SHOW_INSTALL_MENU_BUTTON
             showInstallMenuItem = true;
 #endif
@@ -228,14 +279,14 @@ class ProjectView : Window
                if(node.type == NodeTypes::project)
                {
                   MenuItem mi;
-                                                                                                                                             mi = ide.projectBuildItem;
-                  MenuItem { pop, $"Build"              , b, f7     , NotifySelect = ProjectBuild      , bitmap = mi.bitmap }.disabled = na; mi = ide.projectLinkItem;
-                  MenuItem { pop, $"Relink"             , l         , NotifySelect = ProjectLink       , bitmap = mi.bitmap }.disabled = na; mi = ide.projectRebuildItem;
-                  MenuItem { pop, $"Rebuild"            , r, shiftF7, NotifySelect = ProjectRebuild    , bitmap = mi.bitmap }.disabled = na; mi = ide.projectCleanTargetItem;
-                  MenuItem { pop, $"Clean Target"       , g         , NotifySelect = ProjectCleanTarget, bitmap = mi.bitmap }.disabled = na; mi = ide.projectCleanItem;
-                  MenuItem { pop, $"Clean"              , c         , NotifySelect = ProjectClean      , bitmap = mi.bitmap }.disabled = na; mi = ide.projectRealCleanItem;
-                  MenuItem { pop, $"Real Clean"                     , NotifySelect = ProjectRealClean  , bitmap = mi.bitmap }.disabled = na; mi = ide.projectRegenerateItem;
-                  MenuItem { pop, $"Regenerate Makefile", m         , NotifySelect = ProjectRegenerate , bitmap = mi.bitmap }.disabled = na;
+                                                                                                                                                                        mi = ide.projectBuildItem;
+                  MenuItem { pop, bldMnuStrBuild[outputMode]      , b, f7     , id = outputMode, NotifySelect = ProjectBuild      , bitmap = mi.bitmap }.disabled = na; mi = ide.projectLinkItem;
+                  MenuItem { pop, bldMnuStrRelink[outputMode]     , l         , id = outputMode, NotifySelect = ProjectLink       , bitmap = mi.bitmap }.disabled = na; mi = ide.projectRebuildItem;
+                  MenuItem { pop, bldMnuStrRebuild[outputMode]    , r, shiftF7, id = outputMode, NotifySelect = ProjectRebuild    , bitmap = mi.bitmap }.disabled = na; mi = ide.projectCleanTargetItem;
+                  MenuItem { pop, bldMnuStrCleanTarget[outputMode], g         , id = outputMode, NotifySelect = ProjectCleanTarget, bitmap = mi.bitmap }.disabled = na; mi = ide.projectCleanItem;
+                  MenuItem { pop, bldMnuStrClean[outputMode]      , c         , id = outputMode, NotifySelect = ProjectClean      , bitmap = mi.bitmap }.disabled = na; mi = ide.projectRealCleanItem;
+                  MenuItem { pop, bldMnuStrRealClean[outputMode]              , id = outputMode, NotifySelect = ProjectRealClean  , bitmap = mi.bitmap }.disabled = na; mi = ide.projectRegenerateItem;
+                  MenuItem { pop, $"Regenerate Makefile"          , m                          , NotifySelect = ProjectRegenerate , bitmap = mi.bitmap }.disabled = na;
                   if(showInstallMenuItem)
                   {
                      mi = ide.projectInstallItem;
@@ -285,8 +336,8 @@ class ProjectView : Window
                {
                   MenuItem { pop, $"Open", o, NotifySelect = FileOpenFile };
                   MenuDivider { pop };
-                  MenuItem { pop, $"Clean", l, NotifySelect = FileClean, bitmap = ide.projectCleanItem.bitmap }.disabled = na;
-                  MenuItem { pop, $"Compile", c, Key { f7, ctrl = true}, NotifySelect = FileCompile, bitmap = ide.projectBuildItem.bitmap }.disabled = na;
+                  MenuItem { pop, bldMnuStrClean[outputMode], l, id = outputMode, NotifySelect = FileClean, bitmap = ide.projectCleanItem.bitmap }.disabled = na;
+                  MenuItem { pop, bldMnuStrCompile[outputMode], c, Key { f7, ctrl = true}, id = outputMode, NotifySelect = FileCompile, bitmap = ide.projectBuildItem.bitmap }.disabled = na;
                   if(showDebuggingMenuItems)
                   {
                      char extension[MAX_EXTENSION];
@@ -328,8 +379,8 @@ class ProjectView : Window
                      // MenuItem { pop, $"Add New Behavior Graph...", g, NotifySelect = ProjectAddNewGraph };
                   }
                   MenuDivider { pop };
-                  MenuItem { pop, $"Clean", l, NotifySelect = FileClean, bitmap = ide.projectCleanItem.bitmap }.disabled = na;
-                  MenuItem { pop, $"Compile", c, Key { f7, ctrl = true}, NotifySelect = FileCompile, bitmap = ide.projectBuildItem.bitmap }.disabled = na;
+                  MenuItem { pop, bldMnuStrClean[outputMode], l, id = outputMode, NotifySelect = FileClean, bitmap = ide.projectCleanItem.bitmap }.disabled = na;
+                  MenuItem { pop, bldMnuStrCompile[outputMode], c, Key { f7, ctrl = true}, id = outputMode, NotifySelect = FileCompile, bitmap = ide.projectBuildItem.bitmap }.disabled = na;
                   MenuDivider { pop };
                   MenuItem { pop, $"Remove", r, NotifySelect = FileRemoveFile };
                   MenuDivider { pop };
@@ -352,6 +403,7 @@ class ProjectView : Window
                   }
                };
                popupMenu.Create();
+               ide.rightClickMenuBuildOutputMode = outputMode;
                ide.AdjustPopupBuildMenus();
             }
          }
@@ -372,7 +424,7 @@ class ProjectView : Window
       {
          if(row)
          {
-            ProjectNode node = (ProjectNode)row.tag;
+            ProjectNode node = (ProjectNode)(intptr)row.tag;
             switch(key)
             {
                case altEnter: case Key { keyPadEnter, alt = true }:
@@ -472,7 +524,7 @@ class ProjectView : Window
 
       bool NotifyCollapse(ListBox listBox, DataRow row, bool collapsed)
       {
-         ProjectNode node = (ProjectNode)row.tag;
+         ProjectNode node = (ProjectNode)(intptr)row.tag;
          if(node.type == folder)
             node.icon = collapsed ? folder : openFolder;
          return true;
@@ -554,7 +606,7 @@ class ProjectView : Window
       ide.outputView.ShowClearSelectTab(find); // why this?
    }
 
-   bool OnSaveFile(char * fileName)
+   bool OnSaveFile(const char * fileName)
    {
       for(prj : ide.workspace.projects)
       {
@@ -571,7 +623,7 @@ class ProjectView : Window
       return true;
    }
 
-   bool IsModuleInProject(char * filePath)
+   bool IsModuleInProject(const char * filePath)
    {
       char moduleName[MAX_FILENAME]; //, modulePath[MAX_LOCATION];
       GetLastDirectory(filePath, moduleName);
@@ -603,7 +655,7 @@ class ProjectView : Window
       ProjectNode node = null;
       if(document.fileName)
       {
-         bool excluded;
+         bool excluded = false;
          char winFileName[MAX_LOCATION];
          char * documentFileName = GetSlashPathBuffer(winFileName, document.fileName);
          Project prj;
@@ -631,7 +683,6 @@ class ProjectView : Window
          {
             for(p : ide.workspace.projects)
             {
-               Project pr = p;
                prj = project ? project : p;
                if((n = prj.topNode.FindByFullPath(documentFileName, false)))
                {
@@ -665,10 +716,6 @@ class ProjectView : Window
    bool ProjectPrepareForToolchain(Project project, PrepareMakefileMethod method, bool cleanLog, bool displayCompiler,
       CompilerConfig compiler, ProjectConfig config)
    {
-      bool isReady = true;
-      char message[MAX_F_STRING];
-      LogBox logBox = ide.outputView.buildBox;
-
       ShowOutputBuildLog(cleanLog);
 
       if(displayCompiler)
@@ -719,8 +766,8 @@ class ProjectView : Window
            (method == forceExists && exists) ||
            (method == normal && (!exists || (config && config.makingModified))))
          {
-            char * reason;
-            char * action;
+            const char * reason;
+            const char * action;
             ide.statusBar.text = $"Generating Makefile & Dependencies..."; // Dependencies?
             app.UpdateDisplay();
 
@@ -753,12 +800,12 @@ class ProjectView : Window
       return false;
    }
 
-   bool BuildInterrim(Project prj, BuildType buildType, CompilerConfig compiler, ProjectConfig config, int bitDepth, bool justPrint)
+   bool BuildInterrim(Project prj, BuildType buildType, CompilerConfig compiler, ProjectConfig config, int bitDepth, BuildOutputMode outputMode)
    {
       if(ProjectPrepareForToolchain(prj, normal, true, true, compiler, config))
       {
          ide.outputView.buildBox.Logf($"Building project %s using the %s configuration...\n", prj.name, GetConfigName(config));
-         return Build(prj, buildType, compiler, config, bitDepth, justPrint);
+         return Build(prj, buildType, compiler, config, bitDepth, outputMode);
       }
       return false;
    }
@@ -785,10 +832,12 @@ class ProjectView : Window
                result = DebugStop();
          }
       }
+      app.ProcessInput(true);
+      ShowOutputBuildLog(false);
       return result;
    }
 
-   bool Build(Project prj, BuildType buildType, CompilerConfig compiler, ProjectConfig config, int bitDepth, bool justPrint)
+   bool Build(Project prj, BuildType buildType, CompilerConfig compiler, ProjectConfig config, int bitDepth, BuildOutputMode outputMode)
    {
       bool result = true;
       Window document;
@@ -814,11 +863,11 @@ class ProjectView : Window
 
          // TODO: Disabled until problems fixed... is it fixed?
          if(buildType == rebuild || (config && config.compilingModified))
-            prj.Clean(compiler, config, bitDepth, clean, justPrint);
+            prj.Clean(compiler, config, bitDepth, clean, outputMode);
          else
          {
             if(buildType == relink || (config && config.linkingModified))
-               prj.Clean(compiler, config, bitDepth, cleanTarget, false);
+               prj.Clean(compiler, config, bitDepth, cleanTarget, outputMode);
             if(config && config.symbolGenModified)
             {
                DirExpression objDir = prj.GetObjDir(compiler, config, bitDepth);
@@ -845,7 +894,7 @@ class ProjectView : Window
          ide.AdjustBuildMenus();
          ide.AdjustDebugMenus();
 
-         result = prj.Build(buildType, null, compiler, config, bitDepth, justPrint, normal);
+         result = prj.Build(buildType, null, compiler, config, bitDepth, outputMode, normal);
 
          if(config)
          {
@@ -876,16 +925,17 @@ class ProjectView : Window
 
    bool ProjectBuild(MenuItem selection, Modifiers mods)
    {
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
       if(buildInProgress == none)
       {
          Project prj = project;
-         CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+         CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
          int bitDepth = ide.workspace.bitDepth;
          ProjectConfig config;
          if(selection || !ide.activeClient)
          {
             DataRow row = fileList.currentRow;
-            ProjectNode node = row ? (ProjectNode)row.tag : null;
+            ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
             if(node) prj = node.project;
          }
          else
@@ -897,7 +947,7 @@ class ProjectView : Window
          config = prj.config;
          if(/*prj != project || */!prj.GetConfigIsInDebugSession(config) || !ide.DontTerminateDebugSession($"Project Build"))
          {
-            BuildInterrim(prj, build, compiler, config, bitDepth, mods.ctrl && mods.shift);
+            BuildInterrim(prj, build, compiler, config, bitDepth, mode);
          }
          delete compiler;
       }
@@ -909,13 +959,14 @@ class ProjectView : Window
    bool ProjectInstall(MenuItem selection, Modifiers mods)
    {
       Project prj = project;
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       int bitDepth = ide.workspace.bitDepth;
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
       ProjectConfig config;
       if(selection || !ide.activeClient)
       {
          DataRow row = fileList.currentRow;
-         ProjectNode node = row ? (ProjectNode)row.tag : null;
+         ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
          if(node) prj = node.project;
       }
       else
@@ -928,11 +979,11 @@ class ProjectView : Window
       if(!prj.GetConfigIsInDebugSession(config) ||
             (!ide.DontTerminateDebugSession($"Project Install") && DebugStopForMake(prj, relink, compiler, config)))
       {
-         BuildInterrim(prj, build, compiler, config, bitDepth, mods.ctrl && mods.shift);
+         BuildInterrim(prj, build, compiler, config, bitDepth, mode);
          if(ProjectPrepareForToolchain(prj, normal, false, false, compiler, config))
          {
             ide.outputView.buildBox.Logf($"\nInstalling project %s using the %s configuration...\n", prj.name, GetConfigName(config));
-            Build(prj, install, compiler, config, bitDepth, mods.ctrl && mods.shift);
+            Build(prj, install, compiler, config, bitDepth, mode);
          }
       }
       delete compiler;
@@ -942,13 +993,14 @@ class ProjectView : Window
    bool ProjectLink(MenuItem selection, Modifiers mods)
    {
       Project prj = project;
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       int bitDepth = ide.workspace.bitDepth;
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
       ProjectConfig config;
       if(selection || !ide.activeClient)
       {
          DataRow row = fileList.currentRow;
-         ProjectNode node = row ? (ProjectNode)row.tag : null;
+         ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
          if(node) prj = node.project;
       }
       else
@@ -966,7 +1018,7 @@ class ProjectView : Window
             ide.outputView.buildBox.Logf($"Relinking project %s using the %s configuration...\n", prj.name, GetConfigName(config));
             if(config)
                config.linkingModified = true;
-            Build(prj, relink, compiler, config, bitDepth, mods.ctrl && mods.shift);
+            Build(prj, relink, compiler, config, bitDepth, mode);
          }
       }
       delete compiler;
@@ -975,14 +1027,15 @@ class ProjectView : Window
 
    bool ProjectRebuild(MenuItem selection, Modifiers mods)
    {
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       int bitDepth = ide.workspace.bitDepth;
       Project prj = project;
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
       ProjectConfig config;
       if(selection || !ide.activeClient)
       {
          DataRow row = fileList.currentRow;
-         ProjectNode node = row ? (ProjectNode)row.tag : null;
+         ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
          if(node) prj = node.project;
       }
       else
@@ -1003,7 +1056,7 @@ class ProjectView : Window
                config.compilingModified = true;
                config.makingModified = true;
             }*/ // -- should this still be used depite the new solution of BuildType?
-            Build(prj, rebuild, compiler, config, bitDepth, mods.ctrl && mods.shift);
+            Build(prj, rebuild, compiler, config, bitDepth, mode);
          }
       }
       delete compiler;
@@ -1012,39 +1065,40 @@ class ProjectView : Window
 
    bool ProjectCleanTarget(MenuItem selection, Modifiers mods)
    {
-      CleanProject($"Project Clean Target", $"Cleaning project %s target using the %s configuration...\n", selection, cleanTarget, mods.ctrl && mods.shift);
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
+      CleanProject($"Project Clean Target", $"Cleaning project %s target using the %s configuration...\n", selection, cleanTarget, mode);
       return true;
    }
 
    bool ProjectClean(MenuItem selection, Modifiers mods)
    {
-      CleanProject($"Project Clean", $"Cleaning project %s using the %s configuration...\n", selection, clean, mods.ctrl && mods.shift);
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
+      CleanProject($"Project Clean", $"Cleaning project %s using the %s configuration...\n", selection, clean, mode);
       return true;
    }
 
    bool ProjectRealClean(MenuItem selection, Modifiers mods)
    {
-      CleanProject($"Project Real Clean", $"Removing intermediate objects directory for project %s using the %s configuration...\n", selection, realClean, mods.ctrl && mods.shift);
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
+      CleanProject($"Project Real Clean", $"Removing intermediate objects directory for project %s using the %s configuration...\n", selection, realClean, mode);
       return true;
    }
 
-   void CleanProject(char * terminateDebugSessionMessage, char * cleaningMessageLogFormat, MenuItem selection, CleanType cleanType, bool justPrint)
+   void CleanProject(const char * terminateDebugSessionMessage, const char * cleaningMessageLogFormat, MenuItem selection, CleanType cleanType, BuildOutputMode outputMode)
    {
       Project prj = project;
       Array<Project> projects { };
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       int bitDepth = ide.workspace.bitDepth;
       if(selection)
       {
          OldLink item;
          OldList selectedRows;
-         List<ProjectNode> nodes { };
          fileList.GetMultiSelection(selectedRows);
          for(item = selectedRows.first; item; item = item.next)
          {
-            OldLink i;
             DataRow row = item.data;
-            ProjectNode node = (ProjectNode)row.tag;
+            ProjectNode node = (ProjectNode)(intptr)row.tag;
             if(node.type == project)
                projects.Add(node.project);
          }
@@ -1053,7 +1107,7 @@ class ProjectView : Window
       if(selection || !ide.activeClient)
       {
          DataRow row = fileList.currentRow;
-         ProjectNode node = row ? (ProjectNode)row.tag : null;
+         ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
          if(node) prj = node.project;
          if(projects.count == 0)
             projects.Add(prj);
@@ -1080,7 +1134,7 @@ class ProjectView : Window
                ide.AdjustBuildMenus();
                ide.AdjustDebugMenus();
 
-               prj.Clean(compiler, config, bitDepth, cleanType, justPrint);
+               prj.Clean(compiler, config, bitDepth, cleanType, outputMode);
                buildInProgress = none;
                ide.AdjustBuildMenus();
                ide.AdjustDebugMenus();
@@ -1094,12 +1148,12 @@ class ProjectView : Window
    bool ProjectRegenerate(MenuItem selection, Modifiers mods)
    {
       Project prj = project;
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       ShowOutputBuildLog(true);
       if(selection || !ide.activeClient)
       {
          DataRow row = fileList.currentRow;
-         ProjectNode node = row ? (ProjectNode)row.tag : null;
+         ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
          if(node)
             prj = node.project;
       }
@@ -1117,10 +1171,9 @@ class ProjectView : Window
       return true;
    }
 
-   bool Compile(Project project, List<ProjectNode> nodes, bool justPrint, SingleFileCompileMode mode)
+   bool Compile(Project project, List<ProjectNode> nodes, BuildOutputMode outputMode, SingleFileCompileMode mode)
    {
       bool result = true;
-      char fileName[MAX_LOCATION];
       Window document;
       ProjectConfig config = project.config;
 
@@ -1145,7 +1198,7 @@ class ProjectView : Window
 
       if(result)
       {
-         CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+         CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
          int bitDepth = ide.workspace.bitDepth;
          result = false;
          if(ProjectPrepareForToolchain(project, normal, true, true, compiler, config))
@@ -1159,7 +1212,7 @@ class ProjectView : Window
 
             buildInProgress = compilingFile;
             ide.AdjustBuildMenus();
-            result = project.Compile(nodes, compiler, config, bitDepth, justPrint, mode);
+            result = project.Compile(nodes, compiler, config, bitDepth, outputMode, mode);
             buildInProgress = none;
             ide.AdjustBuildMenus();
          }
@@ -1168,10 +1221,9 @@ class ProjectView : Window
       return result;
    }
 
-   bool Clean(Project project, List<ProjectNode> nodes, bool justPrint)
+   bool Clean(Project project, List<ProjectNode> nodes)
    {
       bool result = true;
-      char fileName[MAX_LOCATION];
       Window document;
       ProjectConfig config = project.config;
 
@@ -1196,7 +1248,7 @@ class ProjectView : Window
 
       if(result)
       {
-         CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+         CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
          int bitDepth = ide.workspace.bitDepth;
          result = false;
          if(ProjectPrepareForToolchain(project, normal, true, true, compiler, config))
@@ -1235,13 +1287,13 @@ class ProjectView : Window
       {
          char fileName[1024];
          char filePath[MAX_LOCATION];
-         ProjectNode parentNode = (ProjectNode)row.tag;
+         ProjectNode parentNode = (ProjectNode)(intptr)row.tag;
          ProjectNode n, fileNode;
          parentNode.GetFileSysMatchingPath(filePath);
          MakePathRelative(filePath, parentNode.project.topNode.path, filePath);
          for(n = parentNode; n && n != parentNode.project.resNode; n = n.parent);
          sprintf(fileName, $"Untitled %d", documentID);
-         fileNode = AddFile(parentNode, fileName, (bool)n, true);
+         fileNode = AddFile(parentNode, fileName, n != null, true);
          fileNode.path = CopyUnixPath(filePath);
          if(fileNode)
          {
@@ -1263,7 +1315,7 @@ class ProjectView : Window
       DataRow row = fileList.currentRow;
       if(row)
       {
-         ProjectNode parentNode = (ProjectNode)row.tag;
+         ProjectNode parentNode = (ProjectNode)(intptr)row.tag;
          NewFolder(parentNode, null, true);
       }
       return true;
@@ -1286,7 +1338,7 @@ class ProjectView : Window
       DataRow row = fileList.currentRow;
       if(row)
       {
-         ProjectNode toNode = (ProjectNode)row.tag;
+         ProjectNode toNode = (ProjectNode)(intptr)row.tag;
          ImportFolder(toNode);
       }
       return true;
@@ -1313,7 +1365,7 @@ class ProjectView : Window
       DataRow row = fileList.currentRow;
       if(row)
       {
-         ProjectNode node = (ProjectNode)row.tag;
+         ProjectNode node = (ProjectNode)(intptr)row.tag;
          if(node.type == project)
             RemoveSelectedNodes();
       }
@@ -1322,7 +1374,7 @@ class ProjectView : Window
 
    bool ProjectUpdateMakefileForAllConfigs(Project project)
    {
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
 
       // This call really does not belong here:
       ide.UpdateToolBarActiveConfigs(false);
@@ -1353,7 +1405,7 @@ class ProjectView : Window
       DataRow row = fileList.currentRow;
       if(row)
       {
-         ProjectNode node = (ProjectNode)row.tag;
+         ProjectNode node = (ProjectNode)(intptr)row.tag;
          NodeProperties { parent = parent, master = this, node = node,
                position = { position.x + 100, position.y + 100 } }.Create();
       }
@@ -1377,13 +1429,13 @@ class ProjectView : Window
       OldLink item;
       OldList selectedRows;
       Project project = null;
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
       List<ProjectNode> nodes { };
       fileList.GetMultiSelection(selectedRows);
       for(item = selectedRows.first; item; item = item.next)
       {
-         OldLink i;
          DataRow row = item.data;
-         ProjectNode node = (ProjectNode)row.tag;
+         ProjectNode node = (ProjectNode)(intptr)row.tag;
          if(!project)
             project = node.project;
          else if(node.project != project)
@@ -1395,7 +1447,7 @@ class ProjectView : Window
       }
       selectedRows.Free(null);
       if(project)
-         Compile(project, nodes, mods.ctrl && mods.shift, normal);
+         Compile(project, nodes, mode, normal);
       else
          ide.outputView.buildBox.Logf($"Please select files from a single project.\n");
       delete nodes;
@@ -1411,9 +1463,8 @@ class ProjectView : Window
       fileList.GetMultiSelection(selectedRows);
       for(item = selectedRows.first; item; item = item.next)
       {
-         OldLink i;
          DataRow row = item.data;
-         ProjectNode node = (ProjectNode)row.tag;
+         ProjectNode node = (ProjectNode)(intptr)row.tag;
          if(!project)
             project = node.project;
          else if(node.project != project)
@@ -1425,7 +1476,7 @@ class ProjectView : Window
       }
       selectedRows.Free(null);
       if(project)
-         Clean(project, nodes, mods.ctrl && mods.shift);
+         Clean(project, nodes);
       else
          ide.outputView.buildBox.Logf($"Please select files from a single project.\n");
       delete nodes;
@@ -1435,7 +1486,8 @@ class ProjectView : Window
    bool FileDebugPrecompile(MenuItem selection, Modifiers mods)
    {
       DataRow row = fileList.currentRow;
-      ProjectNode node = row ? (ProjectNode)row.tag : null;
+      ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
       if(node)
       {
          List<ProjectNode> nodes { };
@@ -1444,7 +1496,7 @@ class ProjectView : Window
             ProjectBuild(selection, mods);
          ide.Update(null);
          if(!stopBuild)
-            Compile(node.project, nodes, mods.ctrl && mods.shift, debugPrecompile);
+            Compile(node.project, nodes, mode, debugPrecompile);
          delete nodes;
       }
       return true;
@@ -1453,7 +1505,8 @@ class ProjectView : Window
    bool FileDebugCompile(MenuItem selection, Modifiers mods)
    {
       DataRow row = fileList.currentRow;
-      ProjectNode node = row ? (ProjectNode)row.tag : null;
+      ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
       if(node)
       {
          List<ProjectNode> nodes { };
@@ -1461,9 +1514,9 @@ class ProjectView : Window
          if(node.type == project)
             ProjectBuild(selection, mods);
          else
-            Compile(node.project, nodes, mods.ctrl && mods.shift, normal);
+            Compile(node.project, nodes, mode, normal);
          if(!stopBuild)
-            Compile(node.project, nodes, mods.ctrl && mods.shift, debugCompile);
+            Compile(node.project, nodes, mode, debugCompile);
          delete nodes;
       }
       return true;
@@ -1472,7 +1525,8 @@ class ProjectView : Window
    bool FileDebugGenerateSymbols(MenuItem selection, Modifiers mods)
    {
       DataRow row = fileList.currentRow;
-      ProjectNode node = row ? (ProjectNode)row.tag : null;
+      ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
+      BuildOutputMode mode = selection ? (BuildOutputMode)selection.id : normal;
       if(node)
       {
          List<ProjectNode> nodes { };
@@ -1480,9 +1534,9 @@ class ProjectView : Window
          if(node.type == project)
             ProjectBuild(selection, mods);
          else
-            Compile(node.project, nodes, mods.ctrl && mods.shift, normal);
+            Compile(node.project, nodes, mode, normal);
          if(!stopBuild)
-            Compile(node.project, nodes, mods.ctrl && mods.shift, debugGenerateSymbols);
+            Compile(node.project, nodes, mode, debugGenerateSymbols);
          delete nodes;
       }
       return true;
@@ -1494,7 +1548,7 @@ class ProjectView : Window
       if(useSelection)
       {
          DataRow row = fileList.currentRow;
-         ProjectNode node = row ? (ProjectNode)row.tag : null;
+         ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
          if(node)
             prj = node.project;
       }
@@ -1504,18 +1558,24 @@ class ProjectView : Window
    void SelectNextProject(bool backwards)
    {
       DataRow row = fileList.currentRow;
-      DataRow currentRow = row;
-      ProjectNode node = (ProjectNode)row.tag;
-      if(node.type != project)
-         row = node.project.topNode.row;
-      else if(backwards)
-         row = row.previous ? row.previous : fileList.lastRow;
-      if(!backwards)
-         row = row.next ? row.next : fileList.firstRow;
-      if(row && row != currentRow)
+      if(!row)
+         row = backwards ? fileList.lastRow : fileList.firstRow;
+
+      if(row)
       {
-         fileList.SelectRow(row);
-         fileList.currentRow = row;
+         DataRow currentRow = row;
+         ProjectNode node = (ProjectNode)(intptr)row.tag;
+         if(node.type != project)
+            row = node.project.topNode.row;
+         else if(backwards)
+            row = row.previous ? row.previous : fileList.lastRow;
+         if(!backwards)
+            row = row.next ? row.next : fileList.firstRow;
+         if(row && row != currentRow)
+         {
+            fileList.SelectRow(row);
+            fileList.currentRow = row;
+         }
       }
    }
 
@@ -1526,7 +1586,7 @@ class ProjectView : Window
       {
          DataRow row = fileList.currentRow;
          if(row)
-            node = (ProjectNode)row.tag;
+            node = (ProjectNode)(intptr)row.tag;
       }
       return node;
    }
@@ -1549,20 +1609,21 @@ class ProjectView : Window
 
    bool Run(MenuItem selection, Modifiers mods)
    {
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       ProjectConfig config = project.config;
       int bitDepth = ide.workspace.bitDepth;
+      bool shellOpen = compiler.hasDocumentOutput;
       String args = new char[maxPathLen];
       args[0] = '\0';
       if(ide.workspace.commandLineArgs)
          //ide.debugger.GetCommandLineArgs(args);
          strcpy(args, ide.workspace.commandLineArgs);
       if(ide.debugger.isActive)
-         project.Run(args, compiler, config, bitDepth);
+         project.Run(args, compiler, config, bitDepth, shellOpen);
       /*else if(config.targetType == sharedLibrary || config.targetType == staticLibrary)
          MessageBox { master = ide, type = ok, text = "Run", contents = "Shared and static libraries cannot be run like executables." }.Modal();*/
-      else if(BuildInterrim(project, run, compiler, config, bitDepth, false))
-         project.Run(args, compiler, config, bitDepth);
+      else if(BuildInterrim(project, run, compiler, config, bitDepth, normal))
+         project.Run(args, compiler, config, bitDepth, shellOpen);
       delete args;
       delete compiler;
       return true;
@@ -1571,7 +1632,7 @@ class ProjectView : Window
    bool DebugStart()
    {
       bool result = false;
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       ProjectConfig config = project.config;
       int bitDepth = ide.workspace.bitDepth;
       bool useValgrind = ide.workspace.useValgrind;
@@ -1583,7 +1644,7 @@ class ProjectView : Window
       else if(project.GetDebug(config) ||
          MessageBox { master = ide, type = okCancel, text = $"Starting Debug", contents = $"Attempting to debug non-debug configuration\nProceed anyways?" }.Modal() == ok)
       {
-         if(/*!IsProjectModified() ||*/ BuildInterrim(project, start, compiler, config, bitDepth, false))
+         if(/*!IsProjectModified() ||*/ BuildInterrim(project, start, compiler, config, bitDepth, normal))
          {
             if(compiler.type.isVC)
             {
@@ -1603,6 +1664,10 @@ class ProjectView : Window
 
                delete pathBackup;
             }
+            else if(compiler.hasDocumentOutput)
+            {
+               project.Run("", compiler, config, bitDepth, true);
+            }
             else
             {
                ide.debugger.Start(compiler, config, bitDepth, useValgrind);
@@ -1614,7 +1679,7 @@ class ProjectView : Window
       return result;
    }
 
-   void GoToError(const char * line, const bool noParsing)
+   void GoToError(const char * line, const bool noParsing, const char * objectFileExt)
    {
       char * colon;
 
@@ -1673,13 +1738,12 @@ class ProjectView : Window
          {
             char moduleName[MAX_LOCATION], filePath[MAX_LOCATION] = "";
             char ext[MAX_EXTENSION] = "";
-            char * bracket;
             ProjectNode node = null;
             if(colon)
             {
-               char * inFileIncludedFrom = strstr(line, stringInFileIncludedFrom);
-               char * from = strstr(line, "from ");
-               char * start = inFileIncludedFrom ? inFileIncludedFrom + strlen(stringInFileIncludedFrom) : from ? from + strlen("from ") : line;
+               const char * inFileIncludedFrom = strstr(line, stringInFileIncludedFrom);
+               const char * from = strstr(line, "from ");
+               const char * start = inFileIncludedFrom ? inFileIncludedFrom + strlen(stringInFileIncludedFrom) : from ? from + strlen("from ") : line;
                int len;
                if(colon < start)
                   start = line;
@@ -1768,7 +1832,7 @@ class ProjectView : Window
                         for(prj : ide.workspace.projects; prj.lastBuildConfigName)
                         {
                            if((config = prj.GetConfig(prj.lastBuildConfigName)))
-                              node = prj.FindNodeByObjectFileName(moduleName, type, dotMain, config);
+                              node = prj.FindNodeByObjectFileName(moduleName, type, dotMain, config, objectFileExt);
                            if(node)
                               break;
                         }
@@ -1777,14 +1841,15 @@ class ProjectView : Window
                      {
                         char name[MAX_FILENAME];
                         Project project = node.project;
-                        CompilerConfig compiler = ideSettings.GetCompilerConfig(project.lastBuildCompilerName);
+                        CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(project.lastBuildCompilerName);
                         if(compiler)
                         {
                            int bitDepth = ide.workspace.bitDepth;
+                           const char * objectFileExt = compiler ? compiler.objectFileExt : objectDefaultFileExt;
                            DirExpression objDir = project.GetObjDir(compiler, config, bitDepth);
                            strcpy(filePath, project.topNode.path);
                            PathCatSlash(filePath, objDir.dir);
-                           node.GetObjectFileName(name, project.configsNameCollisions[config ? config.name : ""], type, dotMain);
+                           node.GetObjectFileName(name, project.configsNameCollisions[config ? config.name : ""], type, dotMain, objectFileExt);
                            PathCatSlash(filePath, name);
                            delete objDir;
                         }
@@ -1800,47 +1865,40 @@ class ProjectView : Window
                moduleName[0] = 0;    // Avoid opening binary files
             if(moduleName[0])
             {
-               CodeEditor codeEditor;
-               if(!filePath[0])
-               {
-                  strcpy(filePath, project.topNode.path);
-                  PathCatSlash(filePath, moduleName);
-               }
+               CodeEditor codeEditor = null;
 
-               codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
-               if(!codeEditor && !strcmp(ext, "c"))
+               if(ide.GoToCodeSelectFile(moduleName, null, project, null, filePath, objectFileExt))
                {
-                  char ecName[MAX_LOCATION];
-                  ChangeExtension(filePath, "ec", ecName);
-                  codeEditor = (CodeEditor)ide.OpenFile(ecName, false, true, null, no, normal, noParsing);
+                  codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
                }
+
                if(!codeEditor)
                {
-                  char path[MAX_LOCATION];
-                  // TOFIX: Improve on this, don't use only filename, make a function
-                  if(ide && ide.workspace)
+                  if(!filePath[0])
                   {
-                     for(prj : ide.workspace.projects)
-                     {
-                        ProjectNode node;
-                        MakePathRelative(filePath, prj.topNode.path, path);
+                     strcpy(filePath, project.topNode.path);
+                     PathCatSlash(filePath, moduleName);
+                  }
 
-                        if((node = prj.topNode.FindWithPath(path, false)))
-                        {
-                           strcpy(filePath, prj.topNode.path);
-                           PathCatSlash(filePath, node.path);
-                           PathCatSlash(filePath, node.name);
-                           codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
-                           if(codeEditor)
-                              break;
-                        }
-                     }
-                     if(!codeEditor && (strchr(moduleName, '/') || strchr(moduleName, '\\')))
+                  codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
+                  if(!codeEditor && !strcmp(ext, "c"))
+                  {
+                     char ecName[MAX_LOCATION];
+                     ChangeExtension(filePath, "ec", ecName);
+                     codeEditor = (CodeEditor)ide.OpenFile(ecName, false, true, null, no, normal, noParsing);
+                  }
+                  if(!codeEditor)
+                  {
+                     char path[MAX_LOCATION];
+                     // TOFIX: Improve on this, don't use only filename, make a function
+                     if(ide && ide.workspace)
                      {
                         for(prj : ide.workspace.projects)
                         {
                            ProjectNode node;
-                           if((node = prj.topNode.FindWithPath(moduleName, false)))
+                           MakePathRelative(filePath, prj.topNode.path, path);
+
+                           if((node = prj.topNode.FindWithPath(path, false)))
                            {
                               strcpy(filePath, prj.topNode.path);
                               PathCatSlash(filePath, node.path);
@@ -1850,21 +1908,37 @@ class ProjectView : Window
                                  break;
                            }
                         }
-                     }
-                     if(!codeEditor)
-                     {
-                        GetLastDirectory(moduleName, moduleName);
-                        for(prj : ide.workspace.projects)
+                        if(!codeEditor && (strchr(moduleName, '/') || strchr(moduleName, '\\')))
                         {
-                           ProjectNode node;
-                           if((node = prj.topNode.Find(moduleName, false)))
+                           for(prj : ide.workspace.projects)
                            {
-                              strcpy(filePath, prj.topNode.path);
-                              PathCatSlash(filePath, node.path);
-                              PathCatSlash(filePath, node.name);
-                              codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
-                              if(codeEditor)
-                                 break;
+                              ProjectNode node;
+                              if((node = prj.topNode.FindWithPath(moduleName, false)))
+                              {
+                                 strcpy(filePath, prj.topNode.path);
+                                 PathCatSlash(filePath, node.path);
+                                 PathCatSlash(filePath, node.name);
+                                 codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
+                                 if(codeEditor)
+                                    break;
+                              }
+                           }
+                        }
+                        if(!codeEditor)
+                        {
+                           GetLastDirectory(moduleName, moduleName);
+                           for(prj : ide.workspace.projects)
+                           {
+                              ProjectNode node;
+                              if((node = prj.topNode.Find(moduleName, false)))
+                              {
+                                 strcpy(filePath, prj.topNode.path);
+                                 PathCatSlash(filePath, node.path);
+                                 PathCatSlash(filePath, node.name);
+                                 codeEditor = (CodeEditor)ide.OpenFile(filePath, false, true, null, no, normal, noParsing);
+                                 if(codeEditor)
+                                    break;
+                              }
                            }
                         }
                      }
@@ -1873,8 +1947,8 @@ class ProjectView : Window
                if(codeEditor && lineNumber)
                {
                   EditBox editBox = codeEditor.editBox;
-                  editBox.GoToLineNum(lineNumber - 1);
-                  editBox.GoToPosition(editBox.line, lineNumber - 1, col ? (col - 1) : 0);
+                  if(editBox.GoToLineNum(lineNumber - 1))
+                     editBox.GoToPosition(editBox.line, lineNumber - 1, col ? (col - 1) : 0);
                }
             }
          }
@@ -1884,15 +1958,24 @@ class ProjectView : Window
    bool OpenNode(ProjectNode node, bool noParsing)
    {
       char filePath[MAX_LOCATION];
-      node.GetFullFilePath(filePath);
-      return ide.OpenFile(filePath, false, true/*false Why was it opening hidden?*/, null, something, normal, noParsing) ? true : false;
+      char ext[MAX_EXTENSION];
+      node.GetFullFilePath(filePath, true);
+
+      GetExtension(filePath, ext);
+      if(binaryDocExt.Find(ext))
+      {
+         ShellOpen(filePath);
+         return true;
+      }
+      else
+         return ide.OpenFile(filePath, false, true/*false Why was it opening hidden?*/, null, something, normal, noParsing) ? true : false;
    }
 
    void AddNode(ProjectNode node, DataRow addTo)
    {
       DataRow row = addTo ? addTo.AddRow() : fileList.AddRow();
 
-      row.tag = (int64)node;
+      row.tag = (int64)(intptr)node;
       node.row = row;
 
       if(node.type == resources)
@@ -1920,7 +2003,7 @@ class ProjectView : Window
       if(projectNode.files)
       {
          ProjectNode child;
-         while(child = projectNode.files.first)
+         while((child = projectNode.files.first))
             DeleteNode(child);
       }
       fileList.DeleteRow(projectNode.row);
@@ -1930,7 +2013,7 @@ class ProjectView : Window
    bool ProjectSave(MenuItem selection, Modifiers mods)
    {
       DataRow row = fileList.currentRow;
-      ProjectNode node = row ? (ProjectNode)row.tag : null;
+      ProjectNode node = row ? (ProjectNode)(intptr)row.tag : null;
       Project prj = node ? node.project : null;
       if(prj)
       {
@@ -1971,13 +2054,13 @@ class ProjectView : Window
 
    bool DebugRestart()
    {
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       ProjectConfig config = project.config;
       int bitDepth = ide.workspace.bitDepth;
       bool useValgrind = ide.workspace.useValgrind;
 
       bool result = false;
-      if(/*!IsProjectModified() ||*/ BuildInterrim(project, restart, compiler, config, bitDepth, false))
+      if(/*!IsProjectModified() ||*/ BuildInterrim(project, restart, compiler, config, bitDepth, normal))
       {
          // For Restart, compiler and config will only be used if for
          // whatever reason (if at all possible) the Debugger is in a
@@ -2010,12 +2093,12 @@ class ProjectView : Window
 
    bool DebugStepInto()
    {
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       ProjectConfig config = project.config;
       int bitDepth = ide.workspace.bitDepth;
       bool useValgrind = ide.workspace.useValgrind;
 
-      if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start, compiler, config, bitDepth, false)))
+      if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start, compiler, config, bitDepth, normal)))
          ide.debugger.StepInto(compiler, config, bitDepth, useValgrind);
       delete compiler;
       return true;
@@ -2023,12 +2106,12 @@ class ProjectView : Window
 
    bool DebugStepOver(bool skip)
    {
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       ProjectConfig config = project.config;
       int bitDepth = ide.workspace.bitDepth;
       bool useValgrind = ide.workspace.useValgrind;
 
-      if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start, compiler, config, bitDepth, false)))
+      if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start, compiler, config, bitDepth, normal)))
          ide.debugger.StepOver(compiler, config, bitDepth, useValgrind, skip);
 
       delete compiler;
@@ -2037,12 +2120,12 @@ class ProjectView : Window
 
    bool DebugStepUntil(bool skip)
    {
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
       ProjectConfig config = project.config;
       int bitDepth = ide.workspace.bitDepth;
       bool useValgrind = ide.workspace.useValgrind;
 
-      if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start, compiler, config, bitDepth, false)))
+      if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start, compiler, config, bitDepth, normal)))
          ide.debugger.StepUntil(compiler, config, bitDepth, useValgrind, skip);
 
       delete compiler;
@@ -2066,7 +2149,7 @@ class ProjectView : Window
          fileDialog.master = parent;
          while(node)
          {
-            node.GetFullFilePath(path);
+            node.GetFullFilePath(path, true);
             while(path[0])
             {
                StripLastDirectory(path, path);
@@ -2129,7 +2212,7 @@ class ProjectView : Window
             }
             Update(null);
             folderNode.row = parentNode.row.AddRowAfter(after ? after.row : null);
-            folderNode.row.tag = (int64)folderNode;
+            folderNode.row.tag = (int64)(intptr)folderNode;
 
             folderNode.row.SetData(null, folderNode);
             fileList.currentRow = folderNode.row;
@@ -2160,16 +2243,16 @@ class ProjectView : Window
       {
          int c;
          DataRow row = fileList.currentRow;
-         ProjectNode parentNode = (ProjectNode)row.tag;
+         ProjectNode parentNode = (ProjectNode)(intptr)row.tag;
          bool addFailed = false;
          int numSelections = fileDialog.numSelections;
-         char ** multiFilePaths = fileDialog.multiFilePaths;
+         const char * const * multiFilePaths = fileDialog.multiFilePaths;
 
          Array<String> nameConflictFiles { };
 
          for(c = 0; c < numSelections; c++)
          {
-            char * filePath = multiFilePaths[c];
+            const char * filePath = multiFilePaths[c];
             FileAttribs exists = FileExists(filePath);
             bool addThisFile = true;
 
@@ -2207,10 +2290,10 @@ class ProjectView : Window
          if(addFailed)
          {
             int len = 0;
-            char * part1 = $"The following file";
-            char * opt1 = $" was ";
-            char * opt2 = $"s were ";
-            char * part2 = $"not added because of identical file name conflict within the project.\n\n";
+            const char * part1 = $"The following file";
+            const char * opt1 = $" was ";
+            const char * opt2 = $"s were ";
+            const char * part2 = $"not added because of identical file name conflict within the project.\n\n";
             char * message;
             len += strlen(part1);
             len += strlen(part2);
@@ -2235,7 +2318,7 @@ class ProjectView : Window
       }
    }
 
-   ProjectNode AddFile(ProjectNode parentNode, char * filePath, bool resources, bool isTemporary)
+   ProjectNode AddFile(ProjectNode parentNode, const char * filePath, bool resources, bool isTemporary)
    {
       ProjectNode result = null;
       ProjectNode after = null;
@@ -2258,13 +2341,13 @@ class ProjectView : Window
          }
          Update(null);
          result.row = parentNode.row.AddRowAfter(after ? after.row : null);
-         result.row.tag = (int64)result;
+         result.row.tag = (int64)(intptr)result;
          result.row.SetData(null, result);
       }
       return result;
    }
 
-   CodeEditor CreateNew(char * upper, char * lower, char * base, char * className)
+   CodeEditor CreateNew(const char * upper, const char * lower, const char * base, char * className)
    {
       CodeEditor codeEditor = null;
       ProjectNode projectNode;
@@ -2275,7 +2358,7 @@ class ProjectView : Window
 
       if(!row) row = project.topNode.row;
 
-      parentNode = (ProjectNode)row.tag;
+      parentNode = (ProjectNode)(intptr)row.tag;
 
       for(node : parentNode.files)
       {
@@ -2286,7 +2369,7 @@ class ProjectView : Window
       for(c = 1; c < 100; c++)
       {
          char string[16];
-         sprintf(string, c ? "%s%d.ec" : "%s.ec", lower, c);
+         sprintf(string, "%s%d.ec", lower, c);
          if((projectNode = parentNode.Add(project, string, after, file, genFile, true)))
             break;
       }
@@ -2300,7 +2383,7 @@ class ProjectView : Window
          Update(null);
          project.ModifiedAllConfigs(true, false, false, true);
          projectNode.row = parentNode.row.AddRowAfter(after ? after.row : null);
-         projectNode.row.tag =(int64)projectNode;
+         projectNode.row.tag = (int64)(intptr)projectNode;
 
          projectNode.row.SetData(null, projectNode);
          fileList.currentRow = projectNode.row;
@@ -2357,7 +2440,7 @@ class ProjectView : Window
       for(item = selection.first; item; item = item.next)
       {
          DataRow row = item.data;
-         ProjectNode node = (ProjectNode)row.tag;
+         ProjectNode node = (ProjectNode)(intptr)row.tag;
          if(node.type == file)
          {
             OpenNode(node, noParsing);
@@ -2381,13 +2464,13 @@ class ProjectView : Window
       {
          OldLink i;
          DataRow row = item.data;
-         ProjectNode n, node = (ProjectNode)row.tag;
+         ProjectNode n, node = (ProjectNode)(intptr)row.tag;
          bool remove = false;
 
          next = item.next;
          for(i = selection.first; i && !remove; i = i.next)
          {
-            ProjectNode iNode = (ProjectNode)((DataRow)i.data).tag;
+            ProjectNode iNode = (ProjectNode)(intptr)((DataRow)i.data).tag;
             for(n = node.parent; n; n = n.parent)
             {
                if(iNode == n)
@@ -2404,7 +2487,7 @@ class ProjectView : Window
       for(item = selection.first; item; item = item.next)
       {
          DataRow row = item.data;
-         ProjectNode node = (ProjectNode)row.tag;
+         ProjectNode node = (ProjectNode)(intptr)row.tag;
          ProjectNode resNode;
          for(resNode = node.parent; resNode; resNode = resNode.parent)
             if(resNode.type == resources)