diff --git a/NEWS.md b/NEWS.md
index 01eebbce..fb5ae43d 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -22,6 +22,8 @@ Red Panda C++ Version 0.13.3
- fix: indent lines displayed at wrong position, when there are folded lines
- fix: if editor's active line color is disabled, caret's position may not be correct redrawn
- fix: insert code snippets will crash, if current compiler set's include dir list is not empty and lib dir list is empty
+ - fix: search around option can't be disabled
+ - enhancement: show a confirm dialog when search/replace around
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/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedPandaIDE_zh_CN.qm
index 6fb3940a..be776f37 100644
Binary files a/RedPandaIDE/RedPandaIDE_zh_CN.qm and b/RedPandaIDE/RedPandaIDE_zh_CN.qm differ
diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts
index c37a15bc..4e8299eb 100644
--- a/RedPandaIDE/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts
@@ -773,9 +773,8 @@ p, li { white-space: pre-wrap; }
链接时加入下列选项
-
- 编译时自动加入字符编码选项
+ 编译时自动加入字符编码选项
@@ -807,6 +806,12 @@ p, li { white-space: pre-wrap; }
删除
+
+
+
+ Convert Executable's Charset
+ 将可执行文件中的字符串转码为
+
@@ -902,12 +907,12 @@ p, li { white-space: pre-wrap; }
选择性能分析器
-
+
确认
-
+
Red Panda C++ will clear current compiler list and search for compilers in the following locations:
'%1'
@@ -916,50 +921,50 @@ Are you really want to continue?
小熊猫C++ 将会清除现有的编译器配置列表,然后在下列文件夹中搜索编译器:<br/> '%1'<br/> '%2'<br />你确定要继续吗?
-
+
ANSI
-
+
UTF-8
-
+
小熊猫C++ 将会清除现有的编译器配置列表,然后在PATH路径中搜索gcc编译器.<br />你确定要继续吗?
-
-
+
+
失败
-
-
+
+
找不到编译器
-
-
+
+
编译器配置名称
-
+
名称
-
+
编译器所在文件夹
-
+
新名称
@@ -6027,6 +6032,26 @@ Are you really want to continue?
无法找到%1程序"%2"
+
+
+
+ C编译器
+
+
+
+
+ C++编译器
+
+
+
+
+ 构建程序(Make)
+
+
+
+
+ 调试器
+
@@ -6093,7 +6118,7 @@ Are you really want to continue?
生成调试信息(-g3)
-
+
您同意小熊猫C++在PATH路径中寻找gcc编译器吗?
@@ -6192,34 +6217,34 @@ Are you really want to continue?
只生成汇编代码(-S)
-
-
+
+
确认
-
+
在验证编译器设置"%1"时遇到了下列问题:
-
+
是否让小熊猫C++删除这些配置,并尝试重新建立配置?
-
+
如果仍然保留这些设置,可能会导致编译错误。<br /><br />请选择“是”,除非您清楚的知道选择“否”的后果,
-
-
+
+
未配置编译器设置。
-
+
您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2
@@ -6244,13 +6269,13 @@ Are you really want to continue?
C++包含文件
-
+
否
-
+
是
@@ -6753,7 +6778,7 @@ Are you really want to continue?
-
+
替换
@@ -6763,10 +6788,36 @@ Are you really want to continue?
在文件中替换
-
+
+
+ Search Around
+ 继续查找
+
+
+
+
+
+ End of file has been reached.
+ 已到达文件结尾。
+
+
+
+
+
+ Do you want to start from beginning?
+ 是否从文件开头继续?
+
+
+
替换这里的"%1"?
+
+
+
+ Replace Around
+ 继续替换
+
SearchResultListModel
@@ -7368,7 +7419,7 @@ Are you really want to continue?
无法读取文件'%1'!
-
+
无法写入文件'%2'!
diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp
index 7741f853..6086f79a 100644
--- a/RedPandaIDE/qsynedit/SynEdit.cpp
+++ b/RedPandaIDE/qsynedit/SynEdit.cpp
@@ -4755,7 +4755,7 @@ void SynEdit::doSetSelText(const QString &Value)
}
int SynEdit::searchReplace(const QString &sSearch, const QString &sReplace, SynSearchOptions sOptions, PSynSearchBase searchEngine,
- SynSearchMathedProc matchedCallback)
+ SynSearchMathedProc matchedCallback, SynSearchConfirmAroundProc confirmAroundCallback)
{
if (!searchEngine)
return 0;
@@ -4917,9 +4917,10 @@ int SynEdit::searchReplace(const QString &sSearch, const QString &sReplace, SynS
ptCurrent.Line--;
else
ptCurrent.Line++;
- if (
- ((ptCurrent.Line < ptStart.Line) || (ptCurrent.Line > ptEnd.Line))
- && bFromCursor){
+ if (((ptCurrent.Line < ptStart.Line) || (ptCurrent.Line > ptEnd.Line))
+ && bFromCursor && sOptions.testFlag(ssoWrapAround)){
+ if (confirmAroundCallback && !confirmAroundCallback())
+ break;
//search start from cursor, search has finished but no result founds
bFromCursor = false;
ptStart.Char = 1;
diff --git a/RedPandaIDE/qsynedit/SynEdit.h b/RedPandaIDE/qsynedit/SynEdit.h
index 542db9f3..d30f1210 100644
--- a/RedPandaIDE/qsynedit/SynEdit.h
+++ b/RedPandaIDE/qsynedit/SynEdit.h
@@ -147,6 +147,7 @@ using SynPaintProc = std::function;
// SynFontStyles& style, QColor& foreground, QColor& background)>;
using SynSearchMathedProc = std::function;
+using SynSearchConfirmAroundProc = std::function;
class SynEdit;
using PSynEdit = std::shared_ptr;
@@ -244,7 +245,8 @@ public:
void setSelText(const QString& text);
int searchReplace(const QString& sSearch, const QString& sReplace, SynSearchOptions options,
- PSynSearchBase searchEngine, SynSearchMathedProc matchedCallback = nullptr);
+ PSynSearchBase searchEngine, SynSearchMathedProc matchedCallback = nullptr,
+ SynSearchConfirmAroundProc confirmAroundCallback = nullptr);
int maxScrollWidth() const;
int maxScrollHeight() const;
diff --git a/RedPandaIDE/qsynedit/TextPainter.cpp b/RedPandaIDE/qsynedit/TextPainter.cpp
index b083d499..fb633f9e 100644
--- a/RedPandaIDE/qsynedit/TextPainter.cpp
+++ b/RedPandaIDE/qsynedit/TextPainter.cpp
@@ -720,7 +720,6 @@ void SynEditTextPainter::PaintFoldAttributes()
// Now loop through all the lines. The indices are valid for Lines.
for (cRow = aFirstRow; cRow<=aLastRow;cRow++) {
vLine = edit->rowToLine(cRow);
- qDebug()< edit->mLines->count() && edit->mLines->count() > 0)
break;
// Set vertical coord
diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
index 08ddb91e..5a8a535f 100644
--- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
+++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
@@ -59,7 +59,6 @@ CompilerSetOptionWidget::~CompilerSetOptionWidget()
void CompilerSetOptionWidget::init()
{
- ui->cbEncoding->setVisible(false);
ui->cbEncodingDetails->setVisible(false);
ui->cbEncoding->clear();
ui->cbEncoding->addItem(tr("ANSI"),ENCODING_SYSTEM_DEFAULT);
@@ -144,7 +143,6 @@ static void loadCompilerSetSettings(Settings::PCompilerSet pSet, Ui::CompilerSet
ui->txtResourceCompiler->setText(pSet->resourceCompiler());
ui->txtProfiler->setText(pSet->profiler());
- ui->cbEncoding->setVisible(pSet->autoAddCharsetParams());
if (pSet->execCharset() == ENCODING_AUTO_DETECT
|| pSet->execCharset() == ENCODING_SYSTEM_DEFAULT
|| pSet->execCharset() == ENCODING_UTF8) {
diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
index 0757cec2..9fcb6130 100644
--- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
+++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
@@ -138,7 +138,7 @@
-
- Convert Executable's Charset
+ Convert Executable's Charset as
diff --git a/RedPandaIDE/widgets/searchdialog.cpp b/RedPandaIDE/widgets/searchdialog.cpp
index fb42d035..a84485bf 100644
--- a/RedPandaIDE/widgets/searchdialog.cpp
+++ b/RedPandaIDE/widgets/searchdialog.cpp
@@ -250,7 +250,15 @@ void SearchDialog::on_btnExecute_clicked()
if (actionType == SearchAction::Find) {
Editor *e = pMainWindow->editorList()->getEditor();
if (e!=nullptr) {
- findCount+=execute(e,ui->cbFind->currentText(),"");
+ findCount+=execute(e,ui->cbFind->currentText(),"",nullptr,
+ [](){
+ return QMessageBox::question(pMainWindow,
+ tr("Continue Search"),
+ tr("End of file has been reached. ")
+ +tr("Do you want to continue from file's beginning?"),
+ QMessageBox::Yes|QMessageBox::No,
+ QMessageBox::Yes) == QMessageBox::Yes;
+ });
}
} else if (actionType == SearchAction::Replace) {
Editor *e = pMainWindow->editorList()->getEditor();
@@ -279,6 +287,14 @@ void SearchDialog::on_btnExecute_clicked()
} else {
return SynSearchAction::ReplaceAll;
}
+ },
+ [](){
+ return QMessageBox::question(pMainWindow,
+ tr("Continue Replace"),
+ tr("End of file has been reached. ")
+ +tr("Do you want to continue from file's beginning?"),
+ QMessageBox::Yes|QMessageBox::No,
+ QMessageBox::Yes) == QMessageBox::Yes;
});
}
@@ -376,7 +392,9 @@ void SearchDialog::on_btnExecute_clicked()
}
}
-int SearchDialog::execute(SynEdit *editor, const QString &sSearch, const QString &sReplace, SynSearchMathedProc matchCallback)
+int SearchDialog::execute(SynEdit *editor, const QString &sSearch, const QString &sReplace,
+ SynSearchMathedProc matchCallback,
+ SynSearchConfirmAroundProc confirmAroundCallback)
{
if (editor==nullptr)
return 0;
@@ -398,7 +416,7 @@ int SearchDialog::execute(SynEdit *editor, const QString &sSearch, const QString
}
return editor->searchReplace(sSearch, sReplace, mSearchOptions,
- mSearchEngine, matchCallback);
+ mSearchEngine, matchCallback, confirmAroundCallback);
}
std::shared_ptr SearchDialog::batchFindInEditor(SynEdit *e, const QString& filename,const QString &keyword)
diff --git a/RedPandaIDE/widgets/searchdialog.h b/RedPandaIDE/widgets/searchdialog.h
index 5d88ded0..260c0067 100644
--- a/RedPandaIDE/widgets/searchdialog.h
+++ b/RedPandaIDE/widgets/searchdialog.h
@@ -61,7 +61,9 @@ private slots:
void on_btnExecute_clicked();
private:
int execute(SynEdit* editor, const QString& sSearch,
- const QString& sReplace, SynSearchMathedProc matchCallback = nullptr);
+ const QString& sReplace,
+ SynSearchMathedProc matchCallback = nullptr,
+ SynSearchConfirmAroundProc confirmAroundCallback = nullptr);
std::shared_ptr batchFindInEditor(SynEdit * editor,const QString& filename, const QString& keyword);
private:
Ui::SearchDialog *ui;