From 3352d413b3ccee0ca9f80ae6f55d9174efbd0f38 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Thu, 4 Nov 2021 21:14:58 +0800 Subject: [PATCH] - fix: find in the current file is not correcly saved in the search history - fix: hit info not correctly displayed in the search result view - fix: If find in files found no hits, search result view will not be shown. - fix: wront indents when paste one line content --- NEWS.md | 6 ++++++ RedPandaIDE/qsynedit/SynEdit.cpp | 16 ++++++++++------ RedPandaIDE/systemconsts.h | 2 +- RedPandaIDE/widgets/searchdialog.cpp | 7 ++++--- RedPandaIDE/widgets/searchresultview.cpp | 3 ++- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/NEWS.md b/NEWS.md index b4989c66..b156d0cc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +Version 0.7.9 + - fix: find in the current file is not correcly saved in the search history + - fix: hit info not correctly displayed in the search result view + - fix: If find in files found no hits, search result view will not be shown. + - fix: wront indents when paste one line content + Version 0.7.8 - enhancement: In problem view's output control, indicates which line is different with the expected - fix: current input/expected not correctly applied when save/run problem cases diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp index 2e695288..44527579 100644 --- a/RedPandaIDE/qsynedit/SynEdit.cpp +++ b/RedPandaIDE/qsynedit/SynEdit.cpp @@ -4974,7 +4974,11 @@ int SynEdit::insertTextByNormalMode(const QString &Value) Start = 0; P = GetEOL(Value,Start); if (PinsertLines(caretY, CountLines(Value,P)); } else { @@ -4994,17 +4998,17 @@ int SynEdit::insertTextByNormalMode(const QString &Value) P = GetEOL(Value,Start); if (P == Start) { if (P=Value.length()) Str += sRightSide; - } - if (mOptions.testFlag(eoAutoIndent)) { - int indentSpaces = calcIndentSpaces(caretY,Str,true); - Str = GetLeftSpacing(indentSpaces,true)+TrimLeft(Str); + if (mOptions.testFlag(eoAutoIndent)) { + int indentSpaces = calcIndentSpaces(caretY,Str,true); + Str = GetLeftSpacing(indentSpaces,true)+TrimLeft(Str); + } } properSetLine(caretY - 1, Str); rescanRange(caretY); diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h index e6deb8dd..9bc6a70c 100644 --- a/RedPandaIDE/systemconsts.h +++ b/RedPandaIDE/systemconsts.h @@ -3,7 +3,7 @@ #include -#define DEVCPP_VERSION "0.7.8" +#define DEVCPP_VERSION "0.7.9" #define APP_SETTSINGS_FILENAME "redpandacpp.ini" #ifdef Q_OS_WIN diff --git a/RedPandaIDE/widgets/searchdialog.cpp b/RedPandaIDE/widgets/searchdialog.cpp index ad3a0568..b4a6d20f 100644 --- a/RedPandaIDE/widgets/searchdialog.cpp +++ b/RedPandaIDE/widgets/searchdialog.cpp @@ -151,6 +151,8 @@ void SearchDialog::on_btnCancel_clicked() void SearchDialog::on_btnExecute_clicked() { int findCount = 0; + ui->cbFind->addItem(ui->cbFind->currentText()); + ui->cbReplace->addItem(ui->cbReplace->currentText()); SearchAction actionType; switch (mTabBar->currentIndex()) { @@ -279,7 +281,7 @@ void SearchDialog::on_btnExecute_clicked() PSearchResults results = pMainWindow->searchResultModel()->addSearchResults( keyword, mSearchOptions, - SearchFileScope::openedFiles + SearchFileScope::currentFile ); Editor * e= pMainWindow->editorList()->getEditor(); if (e!=nullptr) { @@ -337,8 +339,7 @@ void SearchDialog::on_btnExecute_clicked() } pMainWindow->searchResultModel()->notifySearchResultsUpdated(); } - if (findCount>0) - pMainWindow->showSearchPanel(actionType == SearchAction::ReplaceFiles); + pMainWindow->showSearchPanel(actionType == SearchAction::ReplaceFiles); } } diff --git a/RedPandaIDE/widgets/searchresultview.cpp b/RedPandaIDE/widgets/searchresultview.cpp index 3242b507..5554ed35 100644 --- a/RedPandaIDE/widgets/searchresultview.cpp +++ b/RedPandaIDE/widgets/searchresultview.cpp @@ -414,7 +414,8 @@ void SearchResultTreeViewDelegate::paint(QPainter *painter, const QStyleOptionVi QString fullText; if (item->parent==nullptr) { //is filename - fullText = item->filename; + fullText = QString("%1(%2)").arg(item->filename) + .arg(item->results.count()); } else { fullText = QString("%1 %2: %3").arg(tr("Line")).arg(item->line) .arg(item->text);