diff --git a/NEWS.md b/NEWS.md index 4833f184..b74213d1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,7 @@ Red Panda C++ Version 0.13.3 - fix: when show function tips, can't correctly calcuate the current position in the function param list - fix: app will become very slow when processing very long lines. - enhancement: If console pauser doesn't exist, warn and stop running programs. + - fix: app crash when ctrl+click on a #include statement that point to a directory instead of header 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/editor.cpp b/RedPandaIDE/editor.cpp index d32a6903..30337f16 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -1127,6 +1127,7 @@ void Editor::mouseReleaseEvent(QMouseEvent *event) QString s = lines()->getString(p.Line - 1); if (mParser->isIncludeLine(s)) { QString filename = mParser->getHeaderFileName(mFilename,s); + qDebug()<editorList()->getEditorByFilename(filename); if (e) { e->setCaretPositionAndActivate(1,1); diff --git a/RedPandaIDE/editorlist.cpp b/RedPandaIDE/editorlist.cpp index 9206d7a4..1551f297 100644 --- a/RedPandaIDE/editorlist.cpp +++ b/RedPandaIDE/editorlist.cpp @@ -361,7 +361,7 @@ Editor *EditorList::getEditorByFilename(QString filename) //Create a new editor QFileInfo fileInfo(filename); QString fullname = fileInfo.absoluteFilePath(); - if (fileInfo.exists()) + if (fileInfo.exists() && fileInfo.isFile()) return newEditor(fullname,ENCODING_AUTO_DETECT,false,false); return nullptr; }