diff --git a/NEWS.md b/NEWS.md
index 7ff1c76f..8c34f71c 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -14,6 +14,7 @@ Red Panda C++ Version 1.0.0
- enhancement: toggle block comment
- fix: syntax color of #include header filenames not correct
- enhancement: disable "code completion" will disable enhanced syntax highlight
+ - enhancement: match bracket
Red Panda C++ Version 0.14.5
- fix: the "gnu c++ 20" option in compiler set options is wrong
diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts
index 41c3c5e2..a4b02257 100644
--- a/RedPandaIDE/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts
@@ -1272,10 +1272,10 @@ Are you really want to continue?
-
-
-
-
+
+
+
+
错误
@@ -1289,34 +1289,34 @@ Are you really want to continue?
另存为
-
+
要复制的内容超过了行数限制!
-
+
要复制的内容超过了字符数限制!
-
+
要剪切的内容超过了行数限制!
-
+
要剪切的内容超过了字符数限制!
-
+
打印文档
-
-
-
+
+
+
Ctrl+单击以获取更多信息
@@ -1325,27 +1325,27 @@ Are you really want to continue?
未找到符号'%1'!
-
+
找不到astyle程序
-
+
找不到astyle程序"%1".
-
+
断点条件
-
+
输入当前断点的生效条件:
-
+
只读
@@ -3787,7 +3787,7 @@ Are you really want to continue?
-
+
@@ -3811,8 +3811,8 @@ Are you really want to continue?
工具
-
-
+
+
运行
@@ -3823,26 +3823,26 @@ Are you really want to continue?
-
-
+
+
项目
-
+
监视
-
+
结构
-
+
文件
@@ -3852,10 +3852,10 @@ Are you really want to continue?
-
-
-
-
+
+
+
+
调试
@@ -3888,7 +3888,7 @@ Are you really want to continue?
-
+
查找
@@ -3913,7 +3913,7 @@ Are you really want to continue?
替换
-
+
关闭
@@ -3924,12 +3924,12 @@ Are you really want to continue?
-
+
代码
-
+
窗口
@@ -3947,59 +3947,59 @@ Are you really want to continue?
新建
-
+
Ctrl+N
-
+
打开...
-
+
Ctrl+O
-
+
保存
-
+
Ctrl+S
-
+
另存为...
-
+
另存为
-
+
全部保存
-
+
Ctrl+Shift+S
-
+
选项
-
-
-
+
+
+
@@ -4007,62 +4007,62 @@ Are you really want to continue?
-
+
工具输出
-
+
工具面板
-
+
Git
-
+
F9
-
+
F10
-
+
恢复
-
+
Ctrl+Z
-
+
重做
-
+
Ctrl+Y
-
+
剪切
-
+
Ctrl+X
-
+
@@ -4070,144 +4070,144 @@ Are you really want to continue?
复制
-
+
Ctrl+C
-
+
粘贴
-
+
Ctrl+V
-
+
选择全部
-
+
Ctrl+A
-
+
缩进
-
+
取消缩进
-
+
切换注释
-
+
Ctrl+/
-
+
全部收起
-
+
全部展开
-
+
使用ANSI编码
-
+
使用UTF-8编码
-
+
自动检测
-
+
转换为ANSI编码
-
+
转换为UTF-8编码
-
-
+
+
编译运行
-
+
F11
-
-
+
+
全部重编译
-
+
F12
-
+
停止执行
-
+
F6
-
+
F5
-
+
单步跳过
-
+
F7
-
+
单步进入
-
+
试题集
@@ -4263,20 +4263,20 @@ Are you really want to continue?
-
+
TODO
-
+
书签
-
+
试题
@@ -4333,17 +4333,17 @@ Are you really want to continue?
期望输出
-
+
帮助
-
+
重构
-
+
视图
@@ -4352,529 +4352,539 @@ Are you really want to continue?
工具窗口
-
+
主工具栏
-
+
编译器配置集
-
-
+
+
新建源代码文件
-
+
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参考手册
-
+
显示全部工具面板
-
+
Create Repository
创建Git仓库
-
+
提交(Commit)
-
+
撤销(Revert)
-
+
回滚(Reset)
-
+
添加文件
-
+
还原(Restore)
-
+
官方网站
-
+
分支切换(Switch)
-
+
合并(Merge)
-
-
+
+
Log
显示日志(Log)
-
+
远程仓库...
-
+
取回(Fetch)
-
+
拉取(Pull)
-
+
推送(Push)
-
+
隐藏不支持的文件
-
+
切换块注释
-
+
Alt+Shift+A
+
+
+
+ 匹配当前括号
+
+
+
+
+ Ctrl+]
+
工具窗口栏
-
+
状态栏
-
+
Ctrl+Backspace
-
+
中断
-
-
+
+
删除到单词开头
-
+
Ctrl+Shift+B
-
+
删除到单词结尾
-
+
Ctrl+Shift+E
-
+
Add Class...
新建类...
-
-
+
+
New Header
新建头文件...
@@ -4884,47 +4894,47 @@ Are you really want to continue?
插入行
-
+
删除当前行
-
+
Ctrl+D
-
+
复制当前行
-
+
Ctrl+E
-
+
删除当前单词
-
+
Ctrl+Shift+D
-
+
删除到行尾
-
+
Ctrl+Del
-
+
删除到行首
@@ -4933,27 +4943,27 @@ Are you really want to continue?
C/C++参考
-
+
EGE图形库手册
-
+
添加书签
-
+
删除书签
-
+
修改书签说明
-
+
在文件视图中定位
@@ -4962,7 +4972,7 @@ Are you really want to continue?
打开文件夹
-
+
运行参数...
@@ -5598,8 +5608,8 @@ Are you really want to continue?
Git需要用信息进行提交。
-
-
+
+
选择工作文件夹
diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp
index 6cfc2f56..c9b8eed2 100644
--- a/RedPandaIDE/mainwindow.cpp
+++ b/RedPandaIDE/mainwindow.cpp
@@ -7130,3 +7130,12 @@ void MainWindow::on_actionToggle_Block_Comment_triggered()
}
}
+
+void MainWindow::on_actionMatch_Bracket_triggered()
+{
+ Editor * editor = mEditorList->getEditor();
+ if (editor != NULL ) {
+ editor->matchBracket();
+ }
+}
+
diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h
index c5e904d1..93ab94f2 100644
--- a/RedPandaIDE/mainwindow.h
+++ b/RedPandaIDE/mainwindow.h
@@ -609,6 +609,8 @@ private slots:
void on_actionToggle_Block_Comment_triggered();
+ void on_actionMatch_Bracket_triggered();
+
private:
Ui::MainWindow *ui;
EditorList *mEditorList;
diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui
index d5dd495e..f03b3db4 100644
--- a/RedPandaIDE/mainwindow.ui
+++ b/RedPandaIDE/mainwindow.ui
@@ -1422,7 +1422,7 @@
0
0
1114
- 26
+ 25
diff --git a/RedPandaIDE/qsynedit/KeyStrokes.cpp b/RedPandaIDE/qsynedit/KeyStrokes.cpp
index 3e29c2e5..accdba91 100644
--- a/RedPandaIDE/qsynedit/KeyStrokes.cpp
+++ b/RedPandaIDE/qsynedit/KeyStrokes.cpp
@@ -268,5 +268,5 @@ void SynEditKeyStrokes::resetDefaults()
add(SynEditorCommand::ecNormalSelect, Qt::Key_N, Qt::ControlModifier | Qt::ShiftModifier);
add(SynEditorCommand::ecColumnSelect, Qt::Key_C, Qt::ControlModifier | Qt::ShiftModifier);
add(SynEditorCommand::ecLineSelect, Qt::Key_L, Qt::ControlModifier | Qt::ShiftModifier);
- add(SynEditorCommand::ecMatchBracket, Qt::Key_B, Qt::ControlModifier | Qt::ShiftModifier);
+// add(SynEditorCommand::ecMatchBracket, Qt::Key_B, Qt::ControlModifier | Qt::ShiftModifier);
}
diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp
index 26eac580..6e284c57 100644
--- a/RedPandaIDE/qsynedit/SynEdit.cpp
+++ b/RedPandaIDE/qsynedit/SynEdit.cpp
@@ -5699,6 +5699,11 @@ void SynEdit::ExecuteCommand(SynEditorCommand Command, QChar AChar, void *pData)
verticalScrollBar()->setValue(verticalScrollBar()->value()+mMouseWheelScrollSpeed);
break;
case SynEditorCommand::ecMatchBracket:
+ {
+ BufferCoord coord = getMatchingBracket();
+ if (coord.Char!=0 && coord.Line!=0)
+ internalSetCaretXY(coord);
+ }
break;
default:
break;
diff --git a/RedPandaIDE/qsynedit/SynEdit.h b/RedPandaIDE/qsynedit/SynEdit.h
index fff08f45..848b22f0 100644
--- a/RedPandaIDE/qsynedit/SynEdit.h
+++ b/RedPandaIDE/qsynedit/SynEdit.h
@@ -277,6 +277,7 @@ public:
virtual void shifttab() { commandProcessor(SynEditorCommand::ecShiftTab);}
virtual void toggleComment() { commandProcessor(SynEditorCommand::ecToggleComment);}
virtual void toggleBlockComment() { commandProcessor(SynEditorCommand::ecToggleBlockComment);}
+ virtual void matchBracket() { commandProcessor(SynEditorCommand::ecMatchBracket);}
virtual void beginUpdate();
virtual void endUpdate();