diff --git a/NEWS.md b/NEWS.md index f1f17bfc..898c3c77 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ Version 0.7.7 - change: "save" action will be enabled no matter contents in the current editor is modified or not + - fix: focus not correctly set when the current editor is closed + - fix: can't parse old c-style enum variable definition like "enum Test test;" Version 0.7.6 - change: don't auto insert a new line when input an enter between '(' and ')' or between '[' and ']' (indent instead) diff --git a/RedPandaIDE/editorlist.cpp b/RedPandaIDE/editorlist.cpp index b207a820..103fa6c0 100644 --- a/RedPandaIDE/editorlist.cpp +++ b/RedPandaIDE/editorlist.cpp @@ -134,9 +134,9 @@ bool EditorList::closeEditor(Editor* editor, bool transferFocus, bool force) { this->endUpdate(); }); - if (transferFocus && (editor->pageControl()->currentWidget()==editor)) { - //todo: activate & focus the previous editor - } +// if (transferFocus && (editor->pageControl()->currentWidget()==editor)) { +// //todo: activate & focus the previous editor +// } if (editor->inProject() && pMainWindow->project()) { int projIndex = pMainWindow->project()->indexInUnits(editor); @@ -152,7 +152,8 @@ bool EditorList::closeEditor(Editor* editor, bool transferFocus, bool force) { updateLayout(); if (!force) { editor = getEditor(); - pMainWindow->updateClassBrowserForEditor(editor); + editor->activate(); + //pMainWindow->updateClassBrowserForEditor(editor); } if (pageCount()==0) { pMainWindow->updateAppTitle(); diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 3f203ca9..3fe1039a 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -1775,7 +1775,7 @@ void CppParser::handleEnum() if (!mTokenizer[i + 1]->text.startsWith(';')) enumName = mTokenizer[i + 1]->text.trimmed(); } - } else { // enum NAME {...}; + } else if (mIndex+1< mTokenizer.tokenCount() && mTokenizer[mIndex+1]->text.startsWith('{')){ // enum NAME {...}; if ( (mIndex< mTokenizer.tokenCount()) && mTokenizer[mIndex]->text == "class") { //enum class {...} NAME isEnumClass = true; @@ -1791,6 +1791,10 @@ void CppParser::handleEnum() // An opening brace must be present after NAME if ((mIndex >= mTokenizer.tokenCount()) || !mTokenizer[mIndex]->text.startsWith('{')) return; + } else { + // enum NAME blahblah + // it's an old c-style enum variable definition + return; } // Add statement for enum name too