diff --git a/NEWS.md b/NEWS.md
index 1912ddfd..4d699c45 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -19,6 +19,14 @@ Red Panda C++ Version 0.13.3
- fix: project files' charset settings doesn't work correctly
- enhancement: add exec charset option to compiler set settings
- enhancement: delete to word begin /delete to word end
+ - fix: when open a file, all blank lines's indents are removed.
+ - 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
+ - enhancement: auto zoom ui when screen's zoom factor changed (windows)
+ - enhancement: parser not called when open a file, if option "clean parser symbols when hidden" is turned on.
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/HighlighterManager.cpp b/RedPandaIDE/HighlighterManager.cpp
index 3a27b035..3d2489a4 100644
--- a/RedPandaIDE/HighlighterManager.cpp
+++ b/RedPandaIDE/HighlighterManager.cpp
@@ -43,7 +43,7 @@ PSynHighlighter HighlighterManager::getHighlighter(const QString &filename)
|| suffix == "CPP" || suffix =="H" || suffix == "c++"
|| suffix == "h++") {
return getCppHighlighter();
- } else if (suffix == "vs" || suffix == "fs") {
+ } else if (suffix == "vs" || suffix == "fs" || suffix == "frag") {
return getGLSLHighlighter();
}
}
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 4dd712ba..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 />你确定要继续吗?
-
-
+
+
失败
-
-
+
+
找不到编译器
-
-
+
+
编译器配置名称
-
+
名称
-
+
编译器所在文件夹
-
+
新名称
@@ -1262,45 +1267,45 @@ Are you really want to continue?
要剪切的内容超过了字符数限制!
-
+
打印文档
-
-
-
+
+
+
Ctrl+单击以获取更多信息
-
-
+
+
未找到符号'%1'!
-
+
找不到astyle程序
-
+
找不到astyle程序"%1".
-
+
断点条件
-
+
输入当前断点的生效条件:
-
+
只读
@@ -3219,7 +3224,7 @@ Are you really want to continue?
-
+
@@ -3229,54 +3234,54 @@ Are you really want to continue?
编译器
-
-
+
+
编译日志
-
+
文件
-
+
工具
-
-
+
+
运行
-
+
编辑
-
-
+
+
项目
-
+
监视
-
+
结构
-
+
文件
@@ -3285,85 +3290,85 @@ Are you really want to continue?
资源
-
-
-
-
-
+
+
+
+
+
调试
-
+
求值
-
+
调试主控台
-
+
调用栈
-
+
断点
-
+
局部变量
-
-
-
+
+
+
查找
-
+
历史:
-
+
重新查找
-
+
替换为:
-
+
替换
-
+
关闭
-
+
运行
-
-
+
+
代码
-
+
窗口
@@ -3381,249 +3386,249 @@ Are you really want to continue?
新建
-
+
Ctrl+N
-
+
打开...
-
+
Ctrl+O
-
+
保存
-
+
Ctrl+S
-
+
另存为...
-
+
另存为
-
+
全部保存
-
+
Ctrl+Shift+S
-
+
选项
-
-
-
+
+
+
编译
-
+
F9
-
+
F10
-
+
恢复
-
+
Ctrl+Z
-
+
重做
-
+
Ctrl+Y
-
+
剪切
-
+
Ctrl+X
-
+
复制
-
+
Ctrl+C
-
+
粘贴
-
+
Ctrl+V
-
+
选择全部
-
+
Ctrl+A
-
+
缩进
-
+
取消缩进
-
+
切换注释
-
+
Ctrl+/
-
+
全部收起
-
+
全部展开
-
+
使用ANSI编码
-
+
使用UTF-8编码
-
+
自动检测
-
+
转换为ANSI编码
-
+
转换为UTF-8编码
-
-
+
+
编译运行
-
+
F11
-
-
+
+
全部重编译
-
+
F12
-
+
停止执行
-
+
F6
-
+
F5
-
+
单步跳过
-
+
F7
-
+
单步进入
-
+
试题集
@@ -3662,560 +3667,581 @@ Are you really want to continue?
载入试题集
-
+
内存
-
+
Address:
地址表达式:
-
+
取消
-
-
+
+
TODO
-
-
+
+
书签
-
-
-
+
+
+
试题
-
-
+
+
添加试题案例
-
-
+
+
Remove Problem Set
删除试题集
-
-
+
+
打开答案源代码文件
-
-
+
+
Run Current Case
运行所有案例
-
+
测试案例验证选项
-
+
%v/%m
-
+
输出
-
+
输入
-
+
期望输出
-
+
帮助
-
+
重构
-
+
视图
-
+
工具窗口
-
+
主工具栏
-
+
编译器配置集
-
-
+
+
新建源代码文件
-
+
Tab
-
+
Shift+Tab
-
+
F8
-
+
单步跳出
-
+
Ctrl+F8
-
+
执行到光标处
-
+
Ctrl+F5
-
+
继续执行
-
+
F4
-
+
添加监视
-
+
打开CPU信息窗口...
-
+
退出
-
+
查找...
-
+
Ctrl+F
-
+
在文件中查找...
-
+
Ctrl+Shift+F
-
+
替换
-
+
Ctrl+R
-
+
查找下一个
-
+
F3
-
+
查找前一个
-
+
Shift+F3
-
+
删除监视值
-
+
Remove All
删除全部监视值
-
+
修改监视值
-
+
对代码重新排版
-
+
Ctrl+Shift+A
-
+
前一次编辑位置
-
+
Ctrl+Alt+Left
-
+
后一次编辑位置
-
+
Ctrl+Alt+Right
-
+
Ctrl+W
-
+
全部关闭
-
+
Ctrl+Shift+W
-
+
最大化编辑器
-
+
Ctrl+F11
-
+
下一窗口
-
+
Ctrl+Tab
-
+
前一窗口
-
+
Ctrl+Shift+Tab
-
+
切换断点
-
+
Ctrl+F4
-
+
删除所有断点
-
+
设置断点条件...
-
+
跳转到声明处
-
+
跳转到定义处
-
+
查找符号的引用
-
+
打开所在的文件夹
-
+
Ctrl+B
-
+
打开命令行窗口
-
+
文件属性...
-
+
关闭项目
-
+
项目属性
-
+
新建项目...
-
+
新建项目文件
-
+
添加到项目...
-
+
从项目删除
-
+
查看Makefile
-
+
清理构建文件
-
+
在浏览器中打开
-
+
在终端中打开
-
+
关于
-
+
重命名符号
-
+
Shift+F6
-
+
打印...
-
+
Ctrl+P
-
+
导出为RTF
-
+
导出为HTML
-
+
移动到其他视图
-
+
Ctrl+M
-
-
+
+
C++参考手册
-
+
C参考手册
-
+
工具窗口栏
-
+
状态栏
-
+
Ctrl+Backspace
-
+
中断
+
+
+
+
+ 删除到单词开头
+
+
+
+
+ Ctrl+Shift+B
+
+
+
+
+ 删除到单词结尾
+
+
+
+
+ Ctrl+Shift+E
+
插入行
-
+
删除当前行
-
+
Ctrl+D
-
+
复制当前行
-
+
Ctrl+E
-
+
删除当前单词
-
+
Ctrl+Shift+D
-
+
删除到行尾
-
+
Ctrl+Del
-
+
删除到行首
@@ -4224,38 +4250,38 @@ Are you really want to continue?
C/C++参考
-
+
EGE图形库手册
-
+
添加书签
-
+
删除书签
-
+
修改书签说明
-
+
在文件视图中定位
-
+
打开文件夹
-
+
运行参数...
@@ -6006,6 +6032,26 @@ Are you really want to continue?
无法找到%1程序"%2"
+
+
+
+ C编译器
+
+
+
+
+ C++编译器
+
+
+
+
+ 构建程序(Make)
+
+
+
+
+ 调试器
+
@@ -6072,7 +6118,7 @@ Are you really want to continue?
生成调试信息(-g3)
-
+
您同意小熊猫C++在PATH路径中寻找gcc编译器吗?
@@ -6171,34 +6217,34 @@ Are you really want to continue?
只生成汇编代码(-S)
-
-
+
+
确认
-
+
在验证编译器设置"%1"时遇到了下列问题:
-
+
是否让小熊猫C++删除这些配置,并尝试重新建立配置?
-
+
如果仍然保留这些设置,可能会导致编译错误。<br /><br />请选择“是”,除非您清楚的知道选择“否”的后果,
-
-
+
+
未配置编译器设置。
-
+
您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2
@@ -6223,13 +6269,13 @@ Are you really want to continue?
C++包含文件
-
+
否
-
+
是
@@ -6732,7 +6778,7 @@ Are you really want to continue?
-
+
替换
@@ -6742,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
@@ -7347,7 +7419,7 @@ Are you really want to continue?
无法读取文件'%1'!
-
+
无法写入文件'%2'!
diff --git a/RedPandaIDE/autolinkmanager.cpp b/RedPandaIDE/autolinkmanager.cpp
index c7d8c421..cff90af0 100644
--- a/RedPandaIDE/autolinkmanager.cpp
+++ b/RedPandaIDE/autolinkmanager.cpp
@@ -32,7 +32,15 @@ AutolinkManager::AutolinkManager()
PAutolink AutolinkManager::getLink(const QString &header) const
{
- return mLinks.value(header,PAutolink());
+ PAutolink link = mLinks.value(header,PAutolink());
+ if (link)
+ return link;
+ foreach (QString key, mLinks.keys()) {
+ if (header.endsWith("/"+key, PATH_SENSITIVITY)) {
+ return mLinks.value(key);
+ }
+ }
+ return PAutolink();
}
void AutolinkManager::load()
diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp
index 055e5857..be4fbaec 100644
--- a/RedPandaIDE/compiler/compiler.cpp
+++ b/RedPandaIDE/compiler/compiler.cpp
@@ -534,11 +534,10 @@ QString Compiler::parseFileIncludesForAutolink(
PCppParser& parser)
{
QString result;
- QString baseName = extractFileName(filename);
if (parsedFiles.contains(filename))
return result;
parsedFiles.insert(filename);
- PAutolink autolink = pAutolinkManager->getLink(baseName);
+ PAutolink autolink = pAutolinkManager->getLink(filename);
if (autolink) {
result += ' '+autolink->linkOption;
}
diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp
index 913e4a55..3b042902 100644
--- a/RedPandaIDE/editor.cpp
+++ b/RedPandaIDE/editor.cpp
@@ -100,11 +100,6 @@ Editor::Editor(QWidget *parent, const QString& filename,
mFilename = tr("untitled")+QString("%1").arg(getNewFileNumber());
}
QFileInfo fileInfo(mFilename);
- if (mParentPageControl!=nullptr) {
- mParentPageControl->addTab(this,"");
- updateCaption();
- }
-
PSynHighlighter highlighter;
if (!isNew) {
loadFile();
@@ -134,7 +129,6 @@ Editor::Editor(QWidget *parent, const QString& filename,
&& mParser && (mParser->isSystemHeaderFile(mFilename) || mParser->isProjectHeaderFile(mFilename))) {
this->setModified(false);
setReadOnly(true);
- updateCaption();
}
mCompletionPopup = pMainWindow->completionPopup();
@@ -180,6 +174,10 @@ Editor::Editor(QWidget *parent, const QString& filename,
resetBreakpoints();
}
mStatementColors = pMainWindow->statementColors();
+ if (mParentPageControl!=nullptr) {
+ mParentPageControl->addTab(this,"");
+ updateCaption();
+ }
}
Editor::~Editor() {
@@ -524,12 +522,6 @@ void Editor::wheelEvent(QWheelEvent *event) {
void Editor::focusInEvent(QFocusEvent *event)
{
SynEdit::focusInEvent(event);
- if (mParser) {
- connect(mParser.get(),
- &CppParser::onEndParsing,
- this,
- &SynEdit::invalidate);
- }
pMainWindow->updateAppTitle();
pMainWindow->updateEditorActions();
pMainWindow->updateStatusbarForLineCol();
@@ -540,12 +532,6 @@ void Editor::focusInEvent(QFocusEvent *event)
void Editor::focusOutEvent(QFocusEvent *event)
{
SynEdit::focusOutEvent(event);
- if (mParser) {
- disconnect(mParser.get(),
- &CppParser::onEndParsing,
- this,
- &SynEdit::invalidate);
- }
//pMainWindow->updateClassBrowserForEditor(nullptr);
pMainWindow->updateStatusbarForLineCol();
pMainWindow->updateForStatusbarModeInfo();
@@ -1195,6 +1181,40 @@ void Editor::closeEvent(QCloseEvent *)
pMainWindow->functionTip()->hide();
}
+void Editor::showEvent(QShowEvent */*event*/)
+{
+ if (pSettings->codeCompletion().clearWhenEditorHidden()
+ && !inProject()) {
+ initParser();
+ }
+ if (mParser) {
+ connect(mParser.get(),
+ &CppParser::onEndParsing,
+ this,
+ &SynEdit::invalidate);
+ }
+ if (pSettings->codeCompletion().clearWhenEditorHidden()
+ && !inProject()) {
+ reparse();
+ }
+ reparseTodo();
+ setHideTime(QDateTime());
+}
+
+void Editor::hideEvent(QHideEvent */*event*/)
+{
+ if (mParser) {
+ disconnect(mParser.get(),
+ &CppParser::onEndParsing,
+ this,
+ &SynEdit::invalidate);
+ }
+ if (pSettings->codeCompletion().clearWhenEditorHidden()
+ && !inProject() && mParser)
+ mParser->reset();
+ setHideTime(QDateTime::currentDateTime());
+}
+
void Editor::copyToClipboard()
{
if (pSettings->editor().copySizeLimit()) {
@@ -3124,7 +3144,7 @@ QString Editor::getFileHint(const QString &s)
return "";
}
-QString Editor::getParserHint(const QStringList& expression,const QString &s, int line)
+QString Editor::getParserHint(const QStringList& expression,const QString &/*s*/, int line)
{
// This piece of code changes the parser database, possibly making hints and code completion invalid...
QString result;
diff --git a/RedPandaIDE/editor.h b/RedPandaIDE/editor.h
index e2a0247f..beef612c 100644
--- a/RedPandaIDE/editor.h
+++ b/RedPandaIDE/editor.h
@@ -372,6 +372,11 @@ protected:
void mouseReleaseEvent(QMouseEvent *event) override;
void inputMethodEvent(QInputMethodEvent *) override;
void closeEvent(QCloseEvent *event) override;
+
+ // QWidget interface
+protected:
+ void showEvent(QShowEvent *event) override;
+ void hideEvent(QHideEvent *event) override;
};
QString getWordAtPosition(SynEdit* editor,
diff --git a/RedPandaIDE/main.cpp b/RedPandaIDE/main.cpp
index 8121bc0f..a8bf6420 100644
--- a/RedPandaIDE/main.cpp
+++ b/RedPandaIDE/main.cpp
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#include
#include "common.h"
#include "colorscheme.h"
@@ -60,7 +61,8 @@ bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray & /*eventType*/
}
break;
case WM_DPICHANGED:
- //todo
+ setDesktopDpi(HIWORD(pMsg->wParam));
+ pMainWindow->updateDPI();
break;
}
return false;
@@ -159,6 +161,7 @@ int main(int argc, char *argv[])
//set default open folder
QDir::setCurrent(pSettings->environment().defaultOpenFolder());
+ setDesktopDpi(qApp->desktop()->logicalDpiY());
MainWindow mainWindow;
pMainWindow = &mainWindow;
diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp
index 22ce6e38..2ecc9c9f 100644
--- a/RedPandaIDE/mainwindow.cpp
+++ b/RedPandaIDE/mainwindow.cpp
@@ -689,6 +689,11 @@ void MainWindow::setActiveBreakpoint(QString FileName, int Line, bool setFocus)
}
}
+void MainWindow::updateDPI()
+{
+ applySettings();
+}
+
void MainWindow::updateAppTitle()
{
QString appName=tr("Red Panda C++");
@@ -949,8 +954,6 @@ void MainWindow::openFiles(const QStringList &files)
auto end = finally([this] {
this->mEditorList->endUpdate();
mOpenningFiles = false;
- updateEditorParser(ui->EditorTabsLeft);
- updateEditorParser(ui->EditorTabsRight);
});
//Check if there is a project file in the list and open it
for (const QString& file:files) {
@@ -5217,39 +5220,6 @@ PSymbolUsageManager &MainWindow::symbolUsageManager()
return mSymbolUsageManager;
}
-void MainWindow::updateEditorParser(QTabWidget* tabWidget) {
- if (mOpenningFiles)
- return;
- Editor * editor = mEditorList->getEditor(-1,tabWidget);
- if (pSettings->codeCompletion().clearWhenEditorHidden()) {
- for (int i=0;icount();i++) {
- Editor * e = (Editor*)(tabWidget->widget(i));
- if (!e->inProject()) {
- if (e!=editor && e->parser() && !e->notParsed()) {
- e->parser()->reset();
- }
- }
- }
- }
- if (editor && editor->parser() && editor->notParsed()) {
- resetCppParser(editor->parser());
- editor->reparse();
- }
-}
-
-void MainWindow::updateEditorHideTime(QTabWidget* tabWidget) {
- Editor * editor = mEditorList->getEditor(-1,tabWidget);
- for (int i=0;icount();i++) {
- Editor * e = (Editor*)(tabWidget->widget(i));
- if (e!=editor) {
- if (!e->hideTime().isValid())
- e->setHideTime(QDateTime::currentDateTime());
- } else {
- e->setHideTime(QDateTime());
- }
- }
-}
-
void MainWindow::showHideInfosTab(QWidget *widget, bool show)
{
int idx = findTabIndex(ui->tabInfos,widget);
@@ -5388,26 +5358,13 @@ void MainWindow::onEditorRenamed(const QString &oldFilename, const QString &newF
void MainWindow::on_EditorTabsLeft_currentChanged(int)
{
- Editor * editor = mEditorList->getEditor(-1,ui->EditorTabsLeft);
- if (editor) {
- editor->reparseTodo();
- }
- updateEditorParser(ui->EditorTabsLeft);
- updateEditorHideTime(ui->EditorTabsLeft);
}
void MainWindow::on_EditorTabsRight_currentChanged(int)
{
- Editor * editor = mEditorList->getEditor(-1,ui->EditorTabsRight);
- if (editor) {
- editor->reparseTodo();
- }
- updateEditorParser(ui->EditorTabsRight);
- updateEditorHideTime(ui->EditorTabsRight);
}
-
void MainWindow::on_tableTODO_doubleClicked(const QModelIndex &index)
{
PTodoItem item = mTodoModel.getItem(index);
@@ -5417,7 +5374,6 @@ void MainWindow::on_tableTODO_doubleClicked(const QModelIndex &index)
editor->setCaretPositionAndActivate(item->lineNo,item->ch+1);
}
}
-
}
diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h
index fc1f0b29..ebb689ca 100644
--- a/RedPandaIDE/mainwindow.h
+++ b/RedPandaIDE/mainwindow.h
@@ -215,6 +215,7 @@ public slots:
void onTodoParsing(const QString& filename, int lineNo, int ch, const QString& line);
void onTodoParseFinished();
void setActiveBreakpoint(QString FileName, int Line, bool setFocus);
+ void updateDPI();
private:
void prepareProjectForCompile();
@@ -242,8 +243,6 @@ private:
void doCompileRun(RunType runType);
void updateProblemCaseOutput(POJProblemCase problemCase);
void applyCurrentProblemCaseChanges();
- void updateEditorParser(QTabWidget* tabWidget);
- void updateEditorHideTime(QTabWidget* tabWidget);
void showHideInfosTab(QWidget *widget, bool show);
void showHideMessagesTab(QWidget *widget, bool show);
void prepareTabInfosData();
diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp
index 6e60382a..6086f79a 100644
--- a/RedPandaIDE/qsynedit/SynEdit.cpp
+++ b/RedPandaIDE/qsynedit/SynEdit.cpp
@@ -266,14 +266,8 @@ void SynEdit::setCaretXYEx(bool CallEnsureCursorPosVisible, BufferCoord value)
if (mCaretY != value.Line) {
int oldCaretY = mCaretY;
mCaretY = value.Line;
- if (mActiveLineColor.isValid()) {
- invalidateLine(mCaretY);
- invalidateLine(oldCaretY);
- }
- if (mGutter.activeLineTextColor().isValid()) {
- invalidateGutterLine(mCaretY);
- invalidateGutterLine(oldCaretY);
- }
+ invalidateLine(mCaretY);
+ invalidateLine(oldCaretY);
mStatusChanges.setFlag(SynStatusChange::scCaretY);
}
// Call UpdateLastCaretX before DecPaintLock because the event handler it
@@ -4761,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;
@@ -4923,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/TextBuffer.cpp b/RedPandaIDE/qsynedit/TextBuffer.cpp
index c5196e8a..4ca7f828 100644
--- a/RedPandaIDE/qsynedit/TextBuffer.cpp
+++ b/RedPandaIDE/qsynedit/TextBuffer.cpp
@@ -556,18 +556,25 @@ void SynEditStringList::loadFromFile(const QString& filename, const QByteArray&
}
internalClear();
while (true) {
+ if (line.endsWith("\r\n")) {
+ line.remove(line.length()-2,2);
+ } else if (line.endsWith("\r")) {
+ line.remove(line.length()-1,1);
+ } else if (line.endsWith("\n")){
+ line.remove(line.length()-1,1);
+ }
if (allAscii) {
allAscii = isTextAllAscii(line);
}
if (allAscii) {
- addItem(trimRight(QString::fromLatin1(line)));
+ addItem(QString::fromLatin1(line));
} else {
QString newLine = codec->toUnicode(line.constData(),line.length(),&state);
if (state.invalidChars>0) {
needReread = true;
break;
}
- addItem(trimRight(newLine));
+ addItem(newLine);
}
if (file.atEnd()){
break;
@@ -600,7 +607,14 @@ void SynEditStringList::loadFromFile(const QString& filename, const QByteArray&
QString line;
internalClear();
while (textStream.readLineInto(&line)) {
- addItem(trimRight(line));
+ if (line.endsWith("\r\n")) {
+ line.remove(line.length()-2,2);
+ } else if (line.endsWith("\r")) {
+ line.remove(line.length()-1,1);
+ } else if (line.endsWith("\n")){
+ line.remove(line.length()-1,1);
+ }
+ addItem(line);
}
emit inserted(0,mList.count());
}
diff --git a/RedPandaIDE/qsynedit/TextPainter.cpp b/RedPandaIDE/qsynedit/TextPainter.cpp
index 23a69019..fb633f9e 100644
--- a/RedPandaIDE/qsynedit/TextPainter.cpp
+++ b/RedPandaIDE/qsynedit/TextPainter.cpp
@@ -723,7 +723,7 @@ void SynEditTextPainter::PaintFoldAttributes()
if (vLine > edit->mLines->count() && edit->mLines->count() > 0)
break;
// Set vertical coord
- Y = (vLine - edit->mTopLine) * edit->mTextHeight; // limit inside clip rect
+ Y = (cRow - edit->mTopLine) * edit->mTextHeight; // limit inside clip rect
if (edit->mTextHeight % 2 == 1 && vLine % 2 == 0) {
Y++;
}
diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp
index b2b09137..60e05332 100644
--- a/RedPandaIDE/settings.cpp
+++ b/RedPandaIDE/settings.cpp
@@ -1591,22 +1591,22 @@ bool Settings::CompilerSet::validateExes(QString &msg)
msg ="";
if (!fileExists(mCCompiler)) {
msg += QObject::tr("Cannot find the %1 \"%2\"")
- .arg("C Compiler")
+ .arg(QObject::tr("C Compiler"))
.arg(mCCompiler);
}
if (!fileExists(mCppCompiler)) {
msg += QObject::tr("Cannot find the %1 \"%2\"")
- .arg("C++ Compiler")
+ .arg(QObject::tr("C++ Compiler"))
.arg(mCppCompiler);
}
- if (!fileExists(mMake)) {
+ if (!mMake.isEmpty() && !fileExists(mMake)) {
msg += QObject::tr("Cannot find the %1 \"%2\"")
- .arg("Maker")
+ .arg(QObject::tr("Maker"))
.arg(mMake);
}
if (!fileExists(mDebugger)) {
msg += QObject::tr("Cannot find the %1 \"%2\"")
- .arg("Maker")
+ .arg(QObject::tr("Debugger"))
.arg(mDebugger);
}
if (!msg.isEmpty())
@@ -2533,22 +2533,27 @@ void Settings::CompilerSets::clearSets()
void Settings::CompilerSets::findSets()
{
clearSets();
+ QSet searched;
#ifdef Q_OS_WIN
addSets(includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW32"+QDir::separator()+"bin");
addSets(includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW64"+QDir::separator()+"bin");
+ searched.insert(includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW32"+QDir::separator()+"bin");
+ searched.insert(includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW64"+QDir::separator()+"bin");
#endif
+
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QString path = env.value("PATH");
QStringList pathList = path.split(PATH_SEPARATOR);
- QSet searched;
foreach (const QString& s, pathList){
if (searched.contains(s))
continue;;
searched.insert(s);
- if (s!="/bin") // /bin/gcc is symbolic link to /usr/bin/gcc
+ if (s!="/bin") { // /bin/gcc is symbolic link to /usr/bin/gcc
addSets(s);
+ }
}
+
}
void Settings::CompilerSets::saveSets()
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 19fa4142..9fcb6130 100644
--- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
+++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
@@ -138,7 +138,7 @@
-
- Add Charset arguments when calling the compiler
+ Convert Executable's Charset as
diff --git a/RedPandaIDE/settingsdialog/editorcodecompletionwidget.cpp b/RedPandaIDE/settingsdialog/editorcodecompletionwidget.cpp
index eb05e37e..9e35d2a6 100644
--- a/RedPandaIDE/settingsdialog/editorcodecompletionwidget.cpp
+++ b/RedPandaIDE/settingsdialog/editorcodecompletionwidget.cpp
@@ -50,6 +50,7 @@ void EditorCodeCompletionWidget::doLoad()
ui->chkIgnoreCases->setChecked(pSettings->codeCompletion().ignoreCase());
ui->chkAppendFunc->setChecked(pSettings->codeCompletion().appendFunc());
ui->chkShowCodeIns->setChecked(pSettings->codeCompletion().showCodeIns());
+ ui->chkClearWhenEditorHidden->setChecked(pSettings->codeCompletion().clearWhenEditorHidden());
ui->spinMinCharRequired->setValue(pSettings->codeCompletion().minCharRequired());
}
@@ -74,6 +75,7 @@ void EditorCodeCompletionWidget::doSave()
pSettings->codeCompletion().setShowCodeIns(ui->chkShowCodeIns->isChecked());
pSettings->codeCompletion().setMinCharRequired(ui->spinMinCharRequired->value());
+ pSettings->codeCompletion().setClearWhenEditorHidden(ui->chkClearWhenEditorHidden->isChecked());
pSettings->codeCompletion().save();
}
diff --git a/RedPandaIDE/utils.cpp b/RedPandaIDE/utils.cpp
index 66c5baf4..10b14c9e 100644
--- a/RedPandaIDE/utils.cpp
+++ b/RedPandaIDE/utils.cpp
@@ -825,7 +825,7 @@ QString parseMacros(const QString &s)
// Only provide the first lib dir
if (compilerSet->defaultLibDirs().count()>0)
- result.replace("", localizePath(compilerSet->defaultCppIncludeDirs().front()));
+ result.replace("", localizePath(compilerSet->defaultLibDirs().front()));
else
result.replace("","");
}
@@ -1001,12 +1001,12 @@ QString localizePath(const QString &path)
float pointToPixel(float point)
{
- return point * qApp->desktop()->logicalDpiY() / 72;
+ return point * desktopDpi() / 72;
}
float pixelToPoint(float pixel)
{
- return pixel * 72 / qApp->desktop()->logicalDpiY();
+ return pixel * 72 / desktopDpi();
}
@@ -1076,9 +1076,12 @@ QStringList splitProcessCommand(const QString &cmd)
return result;
}
+static float saved_desktop_dpi = -1;
float desktopDpi()
{
- return qApp->desktop()->logicalDpiY();
+ if (saved_desktop_dpi<1)
+ saved_desktop_dpi = qApp->desktop()->logicalDpiY();
+ return saved_desktop_dpi;
}
qulonglong stringToHex(const QString &str, qulonglong defaultValue)
@@ -1089,3 +1092,8 @@ qulonglong stringToHex(const QString &str, qulonglong defaultValue)
return value;
return defaultValue;
}
+
+void setDesktopDpi(float dpi)
+{
+ saved_desktop_dpi = dpi;
+}
diff --git a/RedPandaIDE/utils.h b/RedPandaIDE/utils.h
index fee53bab..de920531 100644
--- a/RedPandaIDE/utils.h
+++ b/RedPandaIDE/utils.h
@@ -232,6 +232,8 @@ class CppParser;
void resetCppParser(std::shared_ptr parser, int compilerSetIndex=-1);
float desktopDpi();
+void setDesktopDpi(float dpi);
+
float pointToPixel(float point);
float pixelToPoint(float pixel);
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;
diff --git a/packages/debian/changelog b/packages/debian/changelog
index 913747cf..46595c61 100644
--- a/packages/debian/changelog
+++ b/packages/debian/changelog
@@ -1,3 +1,9 @@
+redpanda-cpp (0.13.3-1) unstable; urgency=medium
+
+ * Update to 0.13.3
+
+ -- Roy Qu (瞿华) Mon, 24 Jan 2022 21:50:00 +0800
+
redpanda-cpp (0.13.2-1) unstable; urgency=medium
* Update to 0.13.2
diff --git a/windows/installer-scripts/redpanda-i686-nocompiler.nsi b/windows/installer-scripts/redpanda-i686-nocompiler.nsi
index ae93fa74..272564ed 100644
--- a/windows/installer-scripts/redpanda-i686-nocompiler.nsi
+++ b/windows/installer-scripts/redpanda-i686-nocompiler.nsi
@@ -2,7 +2,7 @@
# Startup
!include "config32.nsh"
-!define FINALNAME "RedPanda.C++.32bit.${DEVCPP_VERSION}.No.Compiler.Setup.exe"
+!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.win32.No.Compiler.Setup.exe"
!define DISPLAY_NAME "Red Panda C++ 32bit ${DEVCPP_VERSION}"
!include "MUI2.nsh"
diff --git a/windows/installer-scripts/redpanda-i686.nsi b/windows/installer-scripts/redpanda-i686.nsi
index fbe40f68..7217a43e 100644
--- a/windows/installer-scripts/redpanda-i686.nsi
+++ b/windows/installer-scripts/redpanda-i686.nsi
@@ -3,7 +3,7 @@
!include "config32.nsh"
!define COMPILERFOLDER "MinGW32"
-!define FINALNAME "RedPanda.C++.32bit.${DEVCPP_VERSION}.${COMPILERNAME}.Setup.exe"
+!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.win32.${COMPILERNAME}.Setup.exe"
!define DISPLAY_NAME "Red Panda C++ 32 bit ${DEVCPP_VERSION}"
!include "MUI2.nsh"
diff --git a/windows/installer-scripts/redpanda-nocompiler.nsi b/windows/installer-scripts/redpanda-nocompiler.nsi
index 1a6e0a3b..1ab78745 100644
--- a/windows/installer-scripts/redpanda-nocompiler.nsi
+++ b/windows/installer-scripts/redpanda-nocompiler.nsi
@@ -2,7 +2,7 @@
# Startup
!include "config.nsh"
-!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.No.Compiler.Setup.exe"
+!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.win64.No.Compiler.Setup.exe"
!define DISPLAY_NAME "Red Panda C++ ${DEVCPP_VERSION}"
!include "MUI2.nsh"
diff --git a/windows/installer-scripts/redpanda-x64.nsi b/windows/installer-scripts/redpanda-x64.nsi
index 43def0dc..6fde0fe8 100644
--- a/windows/installer-scripts/redpanda-x64.nsi
+++ b/windows/installer-scripts/redpanda-x64.nsi
@@ -3,7 +3,7 @@
!include "config.nsh"
!define COMPILERFOLDER "MinGW64"
-!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.${COMPILERNAME}.Setup.exe"
+!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.win64.${COMPILERNAME}.Setup.exe"
!define DISPLAY_NAME "Red Panda C++ ${DEVCPP_VERSION}"
!include "MUI2.nsh"