diff --git a/NEWS.md b/NEWS.md index d943cc02..a454e886 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,8 @@ Version 0.2.2 - fix: can't correctly load last open files / project with non-asii characters in path - fix: can't coorectly load last open project - enhancement: show caret when show code/header completions + - fix: correctly display pointer info in watch console + - enhancement: search in project Version 0.2.1 - fix: crash when load last opens diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index 0ba855a4..ba0308e4 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -1281,7 +1281,9 @@ void DebugReader::processWatchOutput(PWatchVar watchVar) varStack.push_back(parentVar); parentVar = newVar; } + currentVar = nullptr; } else if (ch == '}') { + currentVar = nullptr; PWatchVar newVar = std::make_shared(); newVar->parent = parentVar.get(); newVar->name = ""; @@ -1295,11 +1297,14 @@ void DebugReader::processWatchOutput(PWatchVar watchVar) } else if (ch == '=') { // just skip it } else if (ch == ',') { - + currentVar = nullptr; } else { if (currentVar) { - currentVar->value = token; - currentVar = nullptr; + if (currentVar->value.isEmpty()) { + currentVar->value = token; + } else { + currentVar->value += " "+token; + } } else { PWatchVar newVar = std::make_shared(); newVar->parent = parentVar.get(); @@ -1502,6 +1507,18 @@ QStringList DebugReader::tokenize(const QString &s) } tEnd = std::min(i,s.length()); result.append(s.mid(tStart,tEnd-tStart)); + } else if (ch == '(') { + tStart = i; + i++; + while (iisIdentChar(s[wordBegin])) { wordBegin--; } else if (s[wordBegin] == '.' diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index 2fb1c84a..1db97d3c 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -288,7 +288,7 @@ QTabWidget::South - 2 + 3 diff --git a/RedPandaIDE/settingsdialog/projectfileswidget.cpp b/RedPandaIDE/settingsdialog/projectfileswidget.cpp index c37bb042..2f419d44 100644 --- a/RedPandaIDE/settingsdialog/projectfileswidget.cpp +++ b/RedPandaIDE/settingsdialog/projectfileswidget.cpp @@ -226,7 +226,5 @@ void ProjectFilesWidget::on_cbEncodingDetail_currentTextChanged(const QString &a if(!unit) return; unit->setEncoding(ui->cbEncodingDetail->currentText().toLocal8Bit()); - ui->cbEncodingDetail->setVisible(false); - ui->cbEncodingDetail->clear(); } diff --git a/RedPandaIDE/settingsdialog/projectfileswidget.ui b/RedPandaIDE/settingsdialog/projectfileswidget.ui index fc9f097a..343e4d4e 100644 --- a/RedPandaIDE/settingsdialog/projectfileswidget.ui +++ b/RedPandaIDE/settingsdialog/projectfileswidget.ui @@ -136,7 +136,11 @@ - + + + QComboBox::AdjustToContents + + diff --git a/RedPandaIDE/utils.cpp b/RedPandaIDE/utils.cpp index a0c592fd..6c9e9522 100644 --- a/RedPandaIDE/utils.cpp +++ b/RedPandaIDE/utils.cpp @@ -451,7 +451,7 @@ void changeTheme(const QString &themeName) if (!f.exists()) { qDebug()<<"Unable to set stylesheet, file not found\n"; } else { - QApplication::setStyle("fusion"); + QApplication::setStyle("Windowsvista"); f.open(QFile::ReadOnly | QFile::Text); QTextStream ts(&f); dynamic_cast(QApplication::instance())->setStyleSheet(ts.readAll()); diff --git a/RedPandaIDE/widgets/codecompletionlistview.cpp b/RedPandaIDE/widgets/codecompletionlistview.cpp index 65bfc0c7..fca7ce4b 100644 --- a/RedPandaIDE/widgets/codecompletionlistview.cpp +++ b/RedPandaIDE/widgets/codecompletionlistview.cpp @@ -24,7 +24,6 @@ void CodeCompletionListView::focusInEvent(QFocusEvent *event) { Editor *editor = pMainWindow->editorList()->getEditor(); if (editor) { - qDebug()<<"popup:show caret"; editor->showCaret(); } } diff --git a/RedPandaIDE/widgets/searchdialog.cpp b/RedPandaIDE/widgets/searchdialog.cpp index f34f0624..484c6f26 100644 --- a/RedPandaIDE/widgets/searchdialog.cpp +++ b/RedPandaIDE/widgets/searchdialog.cpp @@ -6,6 +6,7 @@ #include "../editorlist.h" #include "../qsynedit/Search.h" #include "../qsynedit/SearchRegex.h" +#include "../project.h" #include #include @@ -68,6 +69,7 @@ void SearchDialog::findInFiles(const QString &text) void SearchDialog::findInFiles(const QString &keyword, SearchFileScope scope, SynSearchOptions options) { mTabBar->setCurrentIndex(1); + ui->cbFind->setCurrentText(keyword); switch(scope) { case SearchFileScope::currentFile: @@ -119,7 +121,8 @@ void SearchDialog::onTabChanged() // Disable project search option when none is open // rbProjectFiles.Enabled := Assigned(MainForm.Project); - ui->rbProject->setEnabled(false); + ui->rbProject->setEnabled(pMainWindow->project()!=nullptr); + ui->rbOpenFiles->setEnabled(pMainWindow->editorList()->pageCount()>0); // if not Assigned(MainForm.Project) then // rbOpenFiles.Checked := true; @@ -289,6 +292,38 @@ void SearchDialog::on_btnExecute_clicked() } pMainWindow->searchResultModel()->notifySearchResultsUpdated(); } else if (ui->rbProject->isChecked()) { + PSearchResults results = pMainWindow->searchResultModel()->addSearchResults( + keyword, + mSearchOptions, + SearchFileScope::wholeProject + ); + for (int i=0;iproject()->units().count();i++) { + Editor * e = pMainWindow->project()->units()[i]->editor(); + QString curFilename = pMainWindow->project()->units()[i]->fileName(); + if (e) { + fileSearched++; + PSearchResultTreeItem parentItem = batchFindInEditor(e, + keyword); + int t = parentItem->results.size(); + findCount+=t; + if (t>0) { + fileHitted++; + results->results.append(parentItem); + } + } else if (fileExists(curFilename)) { + Editor editor(nullptr,curFilename,ENCODING_AUTO_DETECT,false,false,nullptr); + fileSearched++; + PSearchResultTreeItem parentItem = batchFindInEditor(&editor, + keyword); + int t = parentItem->results.size(); + findCount+=t; + if (t>0) { + fileHitted++; + results->results.append(parentItem); + } + + } + } // end else if rbProjectFiles.Checked then begin // for I := 0 to MainForm.Project.Units.Count - 1 do begin // e := MainForm.Project.Units[i].Editor;