- 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);
This commit is contained in:
Roy Qu 2022-01-23 21:04:08 +08:00
parent 62d7f7edb4
commit ebe2dbb95e
5 changed files with 9 additions and 7 deletions

View File

@ -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

View File

@ -84,7 +84,7 @@ void ExecutableRunner::run()
mProcess = std::make_shared<QProcess>();
mProcess->setProgram(mFilename);
mProcess->setArguments(splitProcessCommand(mArguments));
qDebug()<<splitProcessCommand(mArguments);
//qDebug()<<splitProcessCommand(mArguments);
mProcess->setWorkingDirectory(mWorkDir);
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QString path = env.value("PATH");

View File

@ -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;

View File

@ -344,8 +344,8 @@ bool Project::removeUnit(int index, bool doClose , bool removeFile)
PProjectUnit unit = mUnits[index];
qDebug()<<unit->fileName();
qDebug()<<(qint64)unit->editor();
// qDebug()<<unit->fileName();
// qDebug()<<(qint64)unit->editor();
// Attempt to close it
if (doClose && (unit->editor())) {
if (!pMainWindow->editorList()->closeEditor(unit->editor()))

View File

@ -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()) ||