diff --git a/NEWS.md b/NEWS.md index 1be316a5..027d727e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,8 @@ Red Panda C++ Version 0.13.3 - fix: app crash when ctrl+click on a #include statement that point to a directory instead of header file. - fix: ctrl+click on the enum value will jump to the wrong line in it's definition file - fix: line info in the mouse tip of statement not correct + - fix: editor crash when no highlighter is assigned (the editing file is a not c/cpp source file); + - fix: ')' not correctly skip in the editor when no highlighter is assigned (the editing file is a not c/cpp source file); Red Panda C++ Version 0.13.2 - fix: "delete and exit" button in the environtment / folder option page doesn't work correctly diff --git a/RedPandaIDE/compiler/executablerunner.cpp b/RedPandaIDE/compiler/executablerunner.cpp index 5dabeadc..0cd87a03 100644 --- a/RedPandaIDE/compiler/executablerunner.cpp +++ b/RedPandaIDE/compiler/executablerunner.cpp @@ -84,7 +84,7 @@ void ExecutableRunner::run() mProcess = std::make_shared(); mProcess->setProgram(mFilename); mProcess->setArguments(splitProcessCommand(mArguments)); - qDebug()<setWorkingDirectory(mWorkDir); QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); QString path = env.value("PATH"); diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index ca3b2fe5..f5c18b73 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -2267,6 +2267,8 @@ void Editor::initParser() Editor::QuoteStatus Editor::getQuoteStatus() { QuoteStatus Result = QuoteStatus::NotQuote; + if (!highlighter()) + return Result; if ((caretY()>1) && highlighter()->isLastLineStringNotFinished(lines()->ranges(caretY() - 2).state)) Result = QuoteStatus::DoubleQuote; diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index 05ad43ee..a2d812e3 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -344,8 +344,8 @@ bool Project::removeUnit(int index, bool doClose , bool removeFile) PProjectUnit unit = mUnits[index]; - qDebug()<fileName(); - qDebug()<<(qint64)unit->editor(); +// qDebug()<fileName(); +// qDebug()<<(qint64)unit->editor(); // Attempt to close it if (doClose && (unit->editor())) { if (!pMainWindow->editorList()->closeEditor(unit->editor())) diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index b5cd9f41..8322cd83 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -474,8 +474,6 @@ BufferCoord SynEdit::getMatchingBracketEx(BufferCoord APoint) if (mLines->count()<1) return BufferCoord{0,0}; - if (!mHighlighter) - return BufferCoord{0,0}; // get char at caret PosX = std::max(APoint.Char,1); PosY = std::max(APoint.Line,1); @@ -499,13 +497,12 @@ BufferCoord SynEdit::getMatchingBracketEx(BufferCoord APoint) p.Char = PosX; p.Line = PosY; if ((Test == BracketInc) || (Test == BracketDec)) { + isCommentOrStringOrChar = false; if (getHighlighterAttriAtRowCol(p, vDummy, attr)) isCommentOrStringOrChar = (attr == mHighlighter->stringAttribute()) || (attr == mHighlighter->commentAttribute()) || (attr->name() == SYNS_AttrCharacter); - else - isCommentOrStringOrChar = false; if ((Test == BracketInc) && (!isCommentOrStringOrChar)) NumBrackets++; else if ((Test == BracketDec) && (!isCommentOrStringOrChar)) { @@ -534,6 +531,7 @@ BufferCoord SynEdit::getMatchingBracketEx(BufferCoord APoint) p.Char = PosX; p.Line = PosY; if ((Test == BracketInc) || (Test == BracketDec)) { + isCommentOrStringOrChar = false; if (getHighlighterAttriAtRowCol(p, vDummy, attr)) isCommentOrStringOrChar = (attr == mHighlighter->stringAttribute()) ||