diff --git a/NEWS.md b/NEWS.md
index 632b63d5..dd190cdb 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -18,6 +18,7 @@ Red Panda C++ Version 0.13.3
- add a new template for raylib shader apps
- fix: project files' charset settings doesn't work correctly
- enhancement: add exec charset option to compiler set settings
+ - fix: when open a file, all blank lines's indents are removed.
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.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts
index 4dd712ba..c37a15bc 100644
--- a/RedPandaIDE/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts
@@ -1262,45 +1262,45 @@ Are you really want to continue?
要剪切的内容超过了字符数限制!
-
+
Print Document
打印文档
-
-
-
+
+
+
Ctrl+click for more info
Ctrl+单击以获取更多信息
-
-
+
+
Symbol '%1' not found!
未找到符号'%1'!
-
+
astyle not found
找不到astyle程序
-
+
Can't find astyle in "%1".
找不到astyle程序"%1".
-
+
Break point condition
断点条件
-
+
Enter the condition of the breakpoint:
输入当前断点的生效条件:
-
+
Readonly
只读
@@ -3219,7 +3219,7 @@ Are you really want to continue?
-
+
@@ -3229,54 +3229,54 @@ Are you really want to continue?
编译器
-
-
+
+
Compile Log
编译日志
-
+
File
文件
-
+
Tools
工具
-
-
+
+
Run
运行
-
+
Edit
编辑
-
-
+
+
Project
项目
-
+
Watch
监视
-
+
Structure
结构
-
+
Files
文件
@@ -3285,85 +3285,85 @@ Are you really want to continue?
资源
-
-
-
-
-
+
+
+
+
+
Debug
调试
-
+
Evaluate:
求值
-
+
Debug Console
调试主控台
-
+
Call Stack
调用栈
-
+
Breakpoints
断点
-
+
Locals
局部变量
-
-
-
+
+
+
Search
查找
-
+
History:
历史:
-
+
Search Again
重新查找
-
+
Replace with:
替换为:
-
+
Replace
替换
-
+
Close
关闭
-
+
Execute
运行
-
-
+
+
Code
代码
-
+
Window
窗口
@@ -3381,249 +3381,249 @@ Are you really want to continue?
新建
-
+
Ctrl+N
Ctrl+N
-
+
Open...
打开...
-
+
Ctrl+O
Ctrl+O
-
+
Save
保存
-
+
Ctrl+S
Ctrl+S
-
+
Save As...
另存为...
-
+
Save As
另存为
-
+
Save All
全部保存
-
+
Ctrl+Shift+S
Ctrl+Shift+S
-
+
Options
选项
-
-
-
+
+
+
Compile
编译
-
+
F9
F9
-
+
F10
F10
-
+
Undo
恢复
-
+
Ctrl+Z
Ctrl+Z
-
+
Redo
重做
-
+
Ctrl+Y
Ctrl+Y
-
+
Cut
剪切
-
+
Ctrl+X
Ctrl+X
-
+
Copy
复制
-
+
Ctrl+C
Ctrl+C
-
+
Paste
粘贴
-
+
Ctrl+V
Ctrl+V
-
+
Select All
选择全部
-
+
Ctrl+A
Ctrl+A
-
+
Indent
缩进
-
+
UnIndent
取消缩进
-
+
Toggle Comment
切换注释
-
+
Ctrl+/
Ctrl+/
-
+
Collapse All
全部收起
-
+
Uncollapse All
全部展开
-
+
Encode in ANSI
使用ANSI编码
-
+
Encode in UTF-8
使用UTF-8编码
-
+
Auto Detect
自动检测
-
+
Convert to ANSI
转换为ANSI编码
-
+
Convert to UTF-8
转换为UTF-8编码
-
-
+
+
Compile & Run
编译运行
-
+
F11
F11
-
-
+
+
Rebuild All
全部重编译
-
+
F12
F12
-
+
Stop Execution
停止执行
-
+
F6
F6
-
+
F5
F5
-
+
Step Over
单步跳过
-
+
F7
F7
-
+
Step Into
单步进入
-
+
Problem Set
试题集
@@ -3662,560 +3662,581 @@ Are you really want to continue?
载入试题集
-
+
Memory
内存
-
+
Address Expression:
Address:
地址表达式:
-
+
Cancel
取消
-
-
+
+
TODO
TODO
-
-
+
+
Bookmark
书签
-
-
-
+
+
+
Problem
试题
-
-
+
+
Add Probem Case
添加试题案例
-
-
+
+
Remove Problem Case
Remove Problem Set
删除试题集
-
-
+
+
Open Anwser Source File
打开答案源代码文件
-
-
+
+
Run All Cases
Run Current Case
运行所有案例
-
+
Problem Cases Validation Options
测试案例验证选项
-
+
%v/%m
%v/%m
-
+
Output
输出
-
+
Input
输入
-
+
Expected
期望输出
-
+
Help
帮助
-
+
Refactor
重构
-
+
View
视图
-
+
Tool Windows
工具窗口
-
+
Main
主工具栏
-
+
Compiler Set
编译器配置集
-
-
+
+
New Source File
新建源代码文件
-
+
Tab
Tab
-
+
Shift+Tab
Shift+Tab
-
+
F8
F8
-
+
Step Out
单步跳出
-
+
Ctrl+F8
Ctrl+F8
-
+
Run To Cursor
执行到光标处
-
+
Ctrl+F5
Ctrl+F5
-
+
Continue
继续执行
-
+
F4
F4
-
+
Add Watch...
添加监视
-
+
View CPU Window...
打开CPU信息窗口...
-
+
Exit
退出
-
+
Find...
查找...
-
+
Ctrl+F
Ctrl+F
-
+
Find in Files...
在文件中查找...
-
+
Ctrl+Shift+F
Ctrl+Shift+F
-
+
Replace...
替换
-
+
Ctrl+R
Ctrl+R
-
+
Find Next
查找下一个
-
+
F3
F3
-
+
Find Previous
查找前一个
-
+
Shift+F3
Shift+F3
-
+
Remove Watch
删除监视值
-
+
Remove All Watches
Remove All
删除全部监视值
-
+
Modify Watch...
修改监视值
-
+
Reformat Code
对代码重新排版
-
+
Ctrl+Shift+A
Ctrl+Shift+A
-
+
Go back
前一次编辑位置
-
+
Ctrl+Alt+Left
Ctrl+Alt+Left
-
+
Forward
后一次编辑位置
-
+
Ctrl+Alt+Right
Ctrl+Alt+Right
-
+
Ctrl+W
Ctrl+W
-
+
Close All
全部关闭
-
+
Ctrl+Shift+W
Ctrl+Shift+W
-
+
Maximize Editor
最大化编辑器
-
+
Ctrl+F11
Ctrl+F11
-
+
Next
下一窗口
-
+
Ctrl+Tab
Ctrl+Tab
-
+
Previous
前一窗口
-
+
Ctrl+Shift+Tab
Ctrl+Shift+Tab
-
+
Toggle breakpoint
切换断点
-
+
Ctrl+F4
Ctrl+F4
-
+
Clear all breakpoints
删除所有断点
-
+
Breakpoint property...
设置断点条件...
-
+
Goto Declaration
跳转到声明处
-
+
Goto Definition
跳转到定义处
-
+
Find references
查找符号的引用
-
+
Open containing folder
打开所在的文件夹
-
+
Ctrl+B
Ctrl+B
-
+
Open a terminal here
打开命令行窗口
-
+
File Properties...
文件属性...
-
+
Close Project
关闭项目
-
+
Project options
项目属性
-
+
New Project...
新建项目...
-
+
New File
新建项目文件
-
+
Add to project...
添加到项目...
-
+
Remove from project
从项目删除
-
+
View Makefile
查看Makefile
-
+
Clean
清理构建文件
-
+
Open Folder in Explorer
在浏览器中打开
-
+
Open In Terminal
在终端中打开
-
+
About
关于
-
+
Rename Symbol
重命名符号
-
+
Shift+F6
Shift+F6
-
+
Print...
打印...
-
+
Ctrl+P
Ctrl+P
-
+
Export As RTF
导出为RTF
-
+
Export As HTML
导出为HTML
-
+
Move To Other View
移动到其他视图
-
+
Ctrl+M
Ctrl+M
-
-
+
+
C++ Reference
C++参考手册
-
+
C Reference
C参考手册
-
+
Tool Window Bars
工具窗口栏
-
+
Status Bar
状态栏
-
+
Ctrl+Backspace
Ctrl+Backspace
-
+
Interrupt
中断
+
+
+
+ Delete To Word Begin
+ 删除到单词开头
+
+
+
+ Ctrl+Shift+B
+ Ctrl+Shift+B
+
+
+
+ Delete to Word End
+ 删除到单词结尾
+
+
+
+ Ctrl+Shift+E
+ Ctrl+Shift+E
+
Insert Line
插入行
-
+
Delete Line
删除当前行
-
+
Ctrl+D
Ctrl+D
-
+
Duplicate Line
复制当前行
-
+
Ctrl+E
Ctrl+E
-
+
Delete Word
删除当前单词
-
+
Ctrl+Shift+D
Ctrl+Shift+D
-
+
Delete to EOL
删除到行尾
-
+
Ctrl+Del
Ctrl+Del
-
+
Delete to BOL
删除到行首
@@ -4224,38 +4245,38 @@ Are you really want to continue?
C/C++参考
-
+
EGE Manual
EGE图形库手册
-
+
Add Bookmark
添加书签
-
+
Remove Bookmark
删除书签
-
+
Modify Bookmark Description
修改书签说明
-
+
Locate in Files View
在文件视图中定位
-
+
Open Folder
打开文件夹
-
+
Running Parameters...
运行参数...
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/settingsdialog/compilersetoptionwidget.ui b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
index 19fa4142..0757cec2 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