codloc = CodeLocation::ParseCodeLocation(location);
if(codloc)
{
- CodeEditor editor = (CodeEditor)ide.OpenFile(codloc.absoluteFile, normal, true, null, no, normal);
+ CodeEditor editor = (CodeEditor)ide.OpenFile(codloc.absoluteFile, normal, true, null, no, normal, false);
if(editor)
{
EditBox editBox = editor.editBox;
}
}
if(frame.absoluteFile)
- editor = (CodeEditor)ide.OpenFile(frame.absoluteFile, normal, true, null, no, normal);
+ editor = (CodeEditor)ide.OpenFile(frame.absoluteFile, normal, true, null, no, normal, false);
ide.Update(null);
if(editor && frame.line)
{
strcpy(path, ide.workspace.projectDir);
PathCat(path, tempPath);
- codeEditor = (CodeEditor)ide.OpenFile(path, Normal, false, null, no);
+ codeEditor = (CodeEditor)ide.OpenFile(path, Normal, false, null, no, normal, false);
if(!codeEditor)
{
for(srcDir : ide.workspace.sourceDirs)
{
strcpy(path, srcDir);
PathCat(path, tempPath);
- codeEditor = (CodeEditor)ide.OpenFile(path, Normal, false, null, no);
+ codeEditor = (CodeEditor)ide.OpenFile(path, Normal, false, null, no, normal, false);
if(codeEditor) break;
}
}
if(!activeFrame || !activeFrame.absoluteFile)
codeEditor = null;
else
- codeEditor = (CodeEditor)ide.OpenFile(activeFrame.absoluteFile, normal, false, null, no, normal);
+ codeEditor = (CodeEditor)ide.OpenFile(activeFrame.absoluteFile, normal, false, null, no, normal, false);
if(codeEditor)
{
codeEditor.inUseDebug = true;
Designer designer { codeEditor = this, visible = false, saveDialog = codeEditorFormFileDialog };
+ bool noParsing;
+
+ property bool parsing { get { return !noParsing && !ide.noParsing; } };
+
void ProcessCaretMove(EditBox editBox, int line, int charPos)
{
char temp[512];
if(fileName)
{
GetExtension(fileName, ext);
- if(!strcmpi(ext, "ec"))
+ if(parsing && !strcmpi(ext, "ec"))
{
codeModified = true;
EnsureUpToDate();
void UpdateFormCode()
{
if(!this) return;
+ if(!parsing) return;
updatingCode++;
if(codeModified)
void EnsureUpToDate()
{
- if(sheet && codeModified)
+ if(sheet && codeModified && parsing)
ParseCode();
}
Expression memberExp = null;
Identifier realIdentifier = null;
+ if(!parsing) return true;
if(!privateModule) return !didOverride;
insideFunction = null;
EditLine l1, l2;
int x1,y1, x2,y2;
+ if(!parsing) return;
+
charPos = editBox.charPos + 1;
EnsureUpToDate();
bool OnKeyDown(Key key, unichar ch)
{
- if(key == escape || (SmartKey)key == enter)
+ if(key == escape || key.code == enter || key.code == keyPadEnter)
{
StopEditing();
- if((SmartKey)key == enter)
+ if(key.code == enter || key.code == keyPadEnter)
{
if(mode == newFile)
{
Window document;
node.GetFullFilePath(filePath);
if(FileExists(filePath))
- ide.projectView.OpenNode(node);
+ ide.projectView.OpenNode(node, key.ctrl && key.shift);
else
{
document = (Window)NewCodeEditor(ide, normal, false);
{
parent = this;
- void OnGotoError(char * line)
+ void OnGotoError(char * line, bool noParsing)
{
- ide.GoToError(line);
+ ide.GoToError(line, noParsing);
}
void OnCodeLocationParseAndGoTo(char * line)
for(c = 0; c < numSelections; c++)
{
- if(OpenFile(multiFilePaths[c], normal, true, fileTypes[ideFileDialog.fileType].typeExtension, no, normal))
+ if(OpenFile(multiFilePaths[c], normal, true, fileTypes[ideFileDialog.fileType].typeExtension, no, normal, mods.ctrl && mods.shift))
gotWhatWeWant = true;
}
if(gotWhatWeWant ||
delete command;
}
else
- OpenFile(file, normal, true, isProjectFile ? "txt" : null, no, normal);
+ OpenFile(file, normal, true, isProjectFile ? "txt" : null, no, normal, mods.ctrl && mods.shift);
break;
}
id++;
delete command;
}
else
- OpenFile(file, normal, true, null, no, normal);
+ OpenFile(file, normal, true, null, no, normal, mods.ctrl && mods.shift);
break;
}
id++;
ideProjectFileDialog.text = openProjectFileDialogTitle;
if(ideProjectFileDialog.Modal() == ok)
{
- OpenFile(ideProjectFileDialog.filePath, normal, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, normal);
+ OpenFile(ideProjectFileDialog.filePath, normal, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, normal, mods.ctrl && mods.shift);
//ChangeProjectFileDialogDirectory(ideProjectFileDialog.currentDirectory);
}
return true;
{
if(ideProjectFileDialog.Modal() == ok)
{
- if(OpenFile(ideProjectFileDialog.filePath, normal, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, add))
+ if(OpenFile(ideProjectFileDialog.filePath, normal, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, add, mods.ctrl && mods.shift))
break;
if(MessageBox { type = yesNo, master = this, text = $"Error opening project file",
contents = $"Add a different project?" }.Modal() == no)
filter = 1;
};
+ bool noParsing;
+
#ifdef GDB_DEBUG_GUI
GDBDialog gdbDialog
{
if(MessageBox { type = yesNo, master = this/*.parent*/,
text = $"Document has been modified", contents = temp }.Modal() == yes)
{
+ bool noParsing = (this._class == class(CodeEditor) && ((CodeEditor)this).noParsing) ? true : false;
char * fileName = CopyString(this.fileName);
WindowState state = this.state;
Anchor anchor = this.anchor;
this.modifiedDocument = false;
this.Destroy(0);
- this = ide.OpenFile(fileName, normal, true, null, no, normal);
+ this = ide.OpenFile(fileName, normal, true, null, no, normal, noParsing);
if(this)
{
this.anchor = anchor;
return false;
}
- Window OpenFile(char * origFilePath, WindowState state, bool visible, char * type, OpenCreateIfFails createIfFails, OpenMethod openMethod)
+ Window OpenFile(char * origFilePath, WindowState state, bool visible, char * type, OpenCreateIfFails createIfFails, OpenMethod openMethod, bool noParsing)
{
char extension[MAX_EXTENSION] = "";
Window document = null;
{
if(ofi.state != closed)
{
- Window file = OpenFile(ofi.path, normal, true, null, no, normal);
+ Window file = OpenFile(ofi.path, normal, true, null, no, normal, noParsing);
if(file)
{
char fileName[MAX_LOCATION];
!strcmp(extension, "css") || !strcmp(extension, "php") ||
!strcmp(extension, "js"))
{
- CodeEditor editor { parent = this, state = state, visible = false };
+ CodeEditor editor { parent = this, state = state, visible = false, noParsing = noParsing };
editor.updatingCode = true;
if(editor.LoadFile(filePath))
{
}
else
{
- CodeEditor editor { parent = this, state = state, visible = false };
+ CodeEditor editor { parent = this, state = state, visible = false, noParsing = noParsing };
if(editor.LoadFile(filePath))
{
document = editor;
return true;
}
- void GoToError(const char * line)
+ void GoToError(const char * line, bool noParsing)
{
if(projectView)
- projectView.GoToError(line);
+ projectView.GoToError(line, noParsing);
}
void CodeLocationParseAndGoTo(const char * text, Project project, const char * dir)
fileAttribs = FileExists(completePath);
if(fileAttribs.isFile)
{
- CodeEditor codeEditor = (CodeEditor)OpenFile(completePath, normal, true, "", no, normal);
+ CodeEditor codeEditor = (CodeEditor)OpenFile(completePath, normal, true, "", no, normal, false);
if(codeEditor && line)
{
EditBox editBox = codeEditor.editBox;
caps = { width = 40, text = $"CAPS", color = app.GetKeyState(capsState) ? black : Color { 128, 128, 128 } };
statusBar.AddField(caps);
- ovr = { width = 30, text = $"OVR", color = editBox.overwrite ? black : Color { 128, 128, 128 } };
+ ovr = { width = 30, text = $"OVR", color = (editBox && editBox.overwrite) ? black : Color { 128, 128, 128 } };
statusBar.AddField(ovr);
num = { width = 30, text = $"NUM", color = app.GetKeyState(numState) ? black : Color { 128, 128, 128 } };
{
if(!strcmp(app.argv[c], "-t"))
openAsText = true;
+ else if(!strcmp(app.argv[c], "-no-parsing"))
+ ide.noParsing = true;
else if(!strcmp(app.argv[c], "-debug-start"))
debugStart = true;
else if(!strcmp(app.argv[c], "-debug-work-dir"))
break;
}
else
- ide.OpenFile(fullPath, (app.argc == 2) * maximized, true, openAsText ? "txt" : null, yes, normal);
+ ide.OpenFile(fullPath, (app.argc == 2) * maximized, true, openAsText ? "txt" : null, yes, normal, false);
}
else if(strstr(fullPath, "http://") == fullPath)
- ide.OpenFile(fullPath, (app.argc == 2) * maximized, true, openAsText ? "txt" : null, yes, normal);
+ ide.OpenFile(fullPath, (app.argc == 2) * maximized, true, openAsText ? "txt" : null, yes, normal, false);
}
}
if(passThrough && projectView && projectView.project && workspace)
char fullPath[MAX_LOCATION];
GetWorkingDir(fullPath, MAX_LOCATION);
PathCat(fullPath, app.argv[c]);
- ide.OpenFile(fullPath, (app.argc == 2) * maximized, true, null, yes, normal);
+ ide.OpenFile(fullPath, (app.argc == 2) * maximized, true, null, yes, normal, false);
}
*/
size.h = 240;
background = formColor;
- virtual void OnGotoError(char * line);
+ virtual void OnGotoError(char * line, bool noParsing);
virtual void OnCodeLocationParseAndGoTo(char * line);
FindDialog findDialog { master = this, editBox = buildBox, isModal = true, autoCreate = false, text = "Find" };
bool NotifyDoubleClick(EditBox editBox, EditLine line, Modifiers mods)
{
- OnGotoError(editBox.line.text);
+ OnGotoError(editBox.line.text, mods.ctrl && mods.shift);
return false; //true; // why not use true here?
}
bool NotifyKeyDown(EditBox editBox, Key key, unichar ch)
{
- if((SmartKey)key == enter)
+ if(key.code == enter || key.code == keyPadEnter)
{
- OnGotoError(editBox.line.text);
+ OnGotoError(editBox.line.text, key.ctrl && key.shift);
return false;
}
return true;
bool NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
{
// Prevent the double click from reactivating the project view (returns false if we opened something)
- return !OpenSelectedNodes();
+ return !OpenSelectedNodes(mods.ctrl && mods.shift);
}
bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
}
switch(key)
{
- case enter: case keyPadEnter: OpenSelectedNodes(); break;
- case del: RemoveSelectedNodes(); break;
+ case Key { enter, true, true }: OpenSelectedNodes(true); break;
+ case Key { keyPadEnter, true, true }: OpenSelectedNodes(true); break;
+ case enter: case keyPadEnter: OpenSelectedNodes(false); break;
+ case del: RemoveSelectedNodes(); break;
case escape:
{
Window activeClient = ide.activeClient;
bool FileOpenFile(MenuItem selection, Modifiers mods)
{
- OpenSelectedNodes();
+ OpenSelectedNodes(mods.ctrl && mods.shift);
return true;
}
return result;
}
- void GoToError(const char * line)
+ void GoToError(const char * line, const bool noParsing)
{
char * colon;
strcpy(filePath, project.topNode.path);
PathCatSlash(filePath, moduleName);
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal, noParsing);
if(!codeEditor && !strcmp(ext, "c"))
{
char ecName[MAX_LOCATION];
ChangeExtension(filePath, "ec", ecName);
- codeEditor = (CodeEditor)ide.OpenFile(ecName, normal, true, null, no, normal);
+ codeEditor = (CodeEditor)ide.OpenFile(ecName, normal, true, null, no, normal, noParsing);
}
if(!codeEditor)
{
strcpy(filePath, prj.topNode.path);
PathCatSlash(filePath, node.path);
PathCatSlash(filePath, node.name);
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal, noParsing);
if(codeEditor)
break;
}
strcpy(filePath, prj.topNode.path);
PathCatSlash(filePath, node.path);
PathCatSlash(filePath, node.name);
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal, noParsing);
if(codeEditor)
break;
}
}
}
- bool OpenNode(ProjectNode node)
+ bool OpenNode(ProjectNode node, bool noParsing)
{
char filePath[MAX_LOCATION];
node.GetFullFilePath(filePath);
- return ide.OpenFile(filePath, normal, true/*false Why was it opening hidden?*/, null, something, normal) ? true : false;
+ return ide.OpenFile(filePath, normal, true/*false Why was it opening hidden?*/, null, something, normal, noParsing) ? true : false;
}
void AddNode(ProjectNode node, DataRow addTo)
subclass(ClassDesignerBase) designerClass = eClass_GetDesigner(baseClass);
if(designerClass)
{
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, false, null, whatever, normal);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, false, null, whatever, normal, false);
strcpy(name, projectNode.name);
sprintf(name, "%s%d", upper, c);
if(className)
}
else // TODO: fix no symbols generated when ommiting {} for following else
{
- codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, false, null, whatever, normal);
+ codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, false, null, whatever, normal, false);
}
if(codeEditor)
{
}
// Returns true if we opened something
- bool OpenSelectedNodes()
+ bool OpenSelectedNodes(bool noParsing)
{
bool result = false;
OldList selection;
ProjectNode node = (ProjectNode)row.tag;
if(node.type == file)
{
- OpenNode(node);
+ OpenNode(node, noParsing);
result = true;
break;
}