diff --git a/NEWS.md b/NEWS.md
index a40760f2..632b63d5 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -17,6 +17,7 @@ Red Panda C++ Version 0.13.3
- enhancement: highlighter for GLSL (OpenGL Shading Language)
- 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
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 7bfe6f19..4dd712ba 100644
--- a/RedPandaIDE/RedPandaIDE_zh_CN.ts
+++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts
@@ -299,113 +299,113 @@ p, li { white-space: pre-wrap; }
CharsetInfoManager
-
-
-
+
+
+
阿拉伯语系
-
-
-
-
+
+
+
+
希腊语系
-
-
-
-
+
+
+
+
巴尔干语系
-
-
-
-
-
-
-
+
+
+
+
+
+
+
西欧语言
-
-
+
+
中欧语言
-
-
-
-
-
+
+
+
+
-
+
+
西里尔语系
-
-
-
-
+
+
+
+
土耳其语系
-
-
+
+
北欧语系
-
-
-
+
+
+
希伯来语
-
+
泰语
-
-
+
+
日语
-
-
-
+
+
+
中文
-
-
+
+
韩语
-
+
越南语
-
+
东欧语系
-
+
凯尔特语系
@@ -572,7 +572,7 @@ p, li { white-space: pre-wrap; }
[说明]
-
+
无法启动编译器进程'%1'。
@@ -581,27 +581,27 @@ p, li { white-space: pre-wrap; }
无法启动编译进程。
-
+
编译进程启动后崩溃。
-
+
waitFor()函数等待超时。
-
+
在向编译进程输入内容时出错。
-
+
在从编译进程读取内容时出错。
-
+
发生了未知错误。
@@ -688,6 +688,16 @@ p, li { white-space: pre-wrap; }
程序中的文字内容可能无法被正确处理和显示。
+
+
+
+ 找不到Console Pauser程序
+
+
+
+
+ 找不到Console Pauser程序"%1"!
+
CompilerSetDirectoriesWidget
@@ -737,13 +747,13 @@ p, li { white-space: pre-wrap; }
编译器配置方案
-
-
-
-
-
-
-
+
+
+
+
+
+
+
...
@@ -753,17 +763,17 @@ p, li { white-space: pre-wrap; }
基本选项
-
+
编译时加入下列选项:
-
+
链接时加入下列选项
-
+
编译时自动加入字符编码选项
@@ -798,62 +808,62 @@ p, li { white-space: pre-wrap; }
删除
-
+
静态链接所有库
-
+
编译/链接选项
-
+
文件夹
-
+
程序
-
+
选项
-
+
gdb
-
+
gdb server
-
+
资源编辑器(winres)
-
+
C++编译器(g++)
-
+
选择C++编译器
-
+
选择C编译器
-
+
C编译器(gcc)
@@ -862,42 +872,42 @@ p, li { white-space: pre-wrap; }
调试器(gdb)
-
+
性能分析器(gprof)
-
+
-
+
选择make
-
+
选择调试器
-
+
选择资源编译器
-
+
选择性能分析器
-
+
确认
-
+
Red Panda C++ will clear current compiler list and search for compilers in the following locations:
'%1'
@@ -906,40 +916,50 @@ Are you really want to continue?
小熊猫C++ 将会清除现有的编译器配置列表,然后在下列文件夹中搜索编译器:<br/> '%1'<br/> '%2'<br />你确定要继续吗?
-
+
+
+ ANSI
+
+
+
+
+ UTF-8
+
+
+
小熊猫C++ 将会清除现有的编译器配置列表,然后在PATH路径中搜索gcc编译器.<br />你确定要继续吗?
-
-
+
+
失败
-
-
+
+
找不到编译器
-
-
+
+
编译器配置名称
-
+
名称
-
+
编译器所在文件夹
-
+
新名称
@@ -1205,10 +1225,10 @@ Are you really want to continue?
-
-
-
-
+
+
+
+
错误
@@ -1222,65 +1242,65 @@ Are you really want to continue?
另存为
-
+
要复制的内容超过了行数限制!
-
+
要复制的内容超过了字符数限制!
-
+
要剪切的内容超过了行数限制!
-
+
要剪切的内容超过了字符数限制!
-
+
打印文档
-
-
-
+
+
+
Ctrl+单击以获取更多信息
-
-
+
+
未找到符号'%1'!
-
+
找不到astyle程序
-
+
找不到astyle程序"%1".
-
+
断点条件
-
+
输入当前断点的生效条件:
-
+
只读
@@ -2136,7 +2156,7 @@ Are you really want to continue?
ExecutableRunner
-
+
The runner process failed to start.
无法启动程序运行进程'%1'。
@@ -2146,17 +2166,17 @@ Are you really want to continue?
程序运行进程启动后崩溃。
-
+
waitFor()函数等待超时。
-
+
在向程序运行进程写入内容时出错。
-
+
在从程序运行进程读取内容时出错。
@@ -3200,11 +3220,11 @@ Are you really want to continue?
-
-
-
-
-
+
+
+
+
+
编译器
@@ -3280,7 +3300,7 @@ Are you really want to continue?
-
+
调试主控台
@@ -3414,8 +3434,8 @@ Are you really want to continue?
-
-
+
+
编译
@@ -3461,8 +3481,8 @@ Are you really want to continue?
-
-
+
+
复制
@@ -3473,7 +3493,7 @@ Are you really want to continue?
-
+
粘贴
@@ -3484,7 +3504,7 @@ Are you really want to continue?
-
+
选择全部
@@ -3611,7 +3631,7 @@ Are you really want to continue?
-
+
新建试题集
@@ -3630,14 +3650,14 @@ Are you really want to continue?
-
+
保存试题集
-
+
载入试题集
@@ -3977,7 +3997,7 @@ Are you really want to continue?
-
+
删除所有断点
@@ -4078,7 +4098,7 @@ Are you really want to continue?
-
+
重命名符号
@@ -4099,13 +4119,13 @@ Are you really want to continue?
-
+
导出为RTF
-
+
导出为HTML
@@ -4230,7 +4250,7 @@ Are you really want to continue?
-
+
打开文件夹
@@ -4240,7 +4260,7 @@ Are you really want to continue?
运行参数...
-
+
文件编码
@@ -4305,156 +4325,156 @@ Are you really want to continue?
覆写
-
+
关闭项目
-
+
你确定要关闭'%1'吗?
-
-
+
+
确认
-
-
-
+
+
+
源文件尚未编译。
-
-
+
+
现在编译?
-
-
+
+
源文件比可执行程序新。
-
+
重新编译?
-
+
无编译器设置
-
+
没有配置编译器设置。
-
+
无法启动调试器
-
-
+
+
启用调试参数
-
-
+
+
当前编译设置中未启用调试选项(-g3),或启用了信息剥除选项(-s)<br /><br/>是否纠正这一问题?
-
+
项目尚未构建
-
+
项目尚未构建。是否构建?
-
+
宿主程序不存在
-
+
动态链接库(DLL)需要一个宿主程序来运行。
-
+
但它不存在。
-
+
宿主程序不存在
-
+
宿主程序'%1'不存在。
-
+
重新编译?
-
-
+
+
保存上次打开信息失败
-
+
无法删除旧上次打开信息文件'%1'
-
+
无法保存上次打开信息文件'%1'
-
+
载入上次打开信息失败
-
+
无法载入上次打开信息文件'%1'
-
+
打开源代码文件
-
+
显示详细调试器日志
-
+
全部复制
-
-
+
+
清除
@@ -4470,7 +4490,7 @@ Are you really want to continue?
-
+
试题集%1
@@ -4491,68 +4511,68 @@ Are you really want to continue?
或者选择使用其他的网络端口。
-
-
+
+
重新构建项目
-
-
+
+
项目已经被修改过,是否需要重新构建?
-
+
自动保存出错
-
+
自动保存"%1"到"%2"失败:%3
-
+
试题属性...
-
+
设置试题集名称
-
+
试题集名称:
-
+
删除
-
+
删除全部书签
-
+
修改描述
-
-
-
+
+
+
书签描述
-
-
-
+
+
+
描述:
@@ -4561,240 +4581,240 @@ Are you really want to continue?
在调试主控台中显示调试器输出
-
+
清除这次搜索
-
+
删除所有搜索
-
+
断点条件...
-
+
断点条件
-
+
输入当前断点的生效条件:
-
+
Remove all breakpoints
删除所有断点
-
+
删除当前断点
-
+
重命名文件
-
-
+
+
添加文件夹
-
+
新文件夹
-
+
文件夹:
-
+
重命名
-
+
删除文件夹
-
+
按类型排序
-
+
按名称排序
-
+
显示继承的成员
-
+
跳转到声明处
-
+
跳转到定义处
-
+
在编辑器中打开
-
+
使用外部程序打开
-
+
在终端中打开
-
+
在Windows浏览器中打开
-
+
字符集
-
+
已自动保存%1个文件
-
+
设置答案源代码...
-
+
选择其他文件...
-
+
选择答案源代码文件
-
+
C/C++Source Files (*.c *.cpp *.cc *.cxx
C/C++源代码文件 (*.c *.cpp *.cc *.cxx)
-
+
保存项目
-
+
项目'%1'有改动。
-
-
+
+
需要保存吗?
-
-
+
+
文件已发生变化
-
+
新建项目文件?
-
+
您是否要将新建的文件加入项目?
-
-
-
-
+
+
+
+
保存失败
-
+
改变项目编译器配置集
-
+
改变项目的编译器配置集会导致所有的自定义编译器选项被重置。
-
+
你真的想要做那些吗?
-
+
您真的要清除该文件的所有断点吗?
-
+
新建项目
-
+
关闭'%1'以打开新项目?
-
+
文件夹不存在
-
+
文件夹'%1'不存在。是否创建?
-
+
无法创建文件夹
-
+
创建文件夹'%1'失败。
-
+
@@ -4803,125 +4823,125 @@ Are you really want to continue?
小熊猫Dev-C++项目文件 (*.dev)
-
+
新建项目失败
-
+
无法使用模板创建项目
-
+
删除文件
-
+
同时从硬盘上删除文件?
-
+
无标题
-
+
新的项目文件名
-
+
文件名:
-
+
文件已存在!
-
+
文件'%1'已经存在!
-
+
添加到项目
-
+
小熊猫C++项目文件(*.dev)
-
+
重命名出错
-
+
符号'%1'在系统头文件中定义,无法修改。
-
+
新名称
-
-
+
+
替换出错
-
+
无法打开文件'%1'进行替换!
-
+
内容和上次查找时不一致。
-
+
RTF格式文件 (*.rtf)
-
+
HTML文件 (*.html)
-
+
当前的试题集不是空的。
-
+
试题%1
-
-
+
+
试题集文件 (*.pbs)
-
+
载入失败
-
-
+
+
试题案例%1
@@ -4932,15 +4952,15 @@ Are you really want to continue?
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
错误
@@ -4950,75 +4970,75 @@ Are you really want to continue?
项目历史
-
+
磁盘文件'%1'已被修改。
-
+
是否重新读取它的内容?
-
+
磁盘文件'%1'已被删除。
-
+
是否保持它在小熊猫C++中打开的编辑窗口?
-
+
打开
-
+
编译失败
-
+
运行失败
-
-
+
+
确认转换
-
-
+
+
当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗?
-
+
新监视表达式
-
+
输入监视表达式
-
+
(%1/%2)正在解析文件"%3"
-
-
+
+
完成%1个文件的解析,用时%2秒
-
+
(每秒%1个文件)
@@ -5165,68 +5185,68 @@ Are you really want to continue?
无法保存文件'%1'.
-
+
载入文件错误
-
+
文件已存在
-
+
文件'%1'已在项目中
-
+
项目已升级
-
+
已成功将项目升级到新的格式
-
+
旧项目文件备份在'%1'。
-
+
设置需要更新
-
+
The compiler settings format of Dev-C++ has changed.
小熊猫C++的编译器设置格式已发生改变。
-
+
请在项目 >> 项目属性 >> 编译器设置中修改您的设置并保存您的项目
-
+
未找到编译器
-
+
您为该项目设置的编译器不存在。
-
+
它将会被全局编译器设置代替。
-
+
Developed using the Red Panda Dev-C++ IDE
使用小熊猫C++编辑器开发
@@ -5283,37 +5303,37 @@ Are you really want to continue?
无法写入文件'%1'!
-
+
- 资源文件: %1
-
+
正在编译项目修改...
-
+
- 项目文件名: %1
-
+
- 编译器配置: %1
-
+
正在处理makefile...
-
+
- makefile处理器: %1
-
+
- 命令: %1 %2
@@ -5455,12 +5475,12 @@ Are you really want to continue?
自定义构建命令
-
+
自动检测
-
+
ANSI
@@ -5469,7 +5489,7 @@ Are you really want to continue?
ANSI
-
+
@@ -5567,24 +5587,24 @@ Are you really want to continue?
共%1个文件[%2个源程序文件,%3个头文件,%4个资源文件,%5个其他文件]
-
+
无法删除旧图标文件
-
+
无法删除旧图标文件'%1'
-
+
选择图标文件
-
-
- 图标文件 (*.ico)
+
+
+ 图像文件 (*.ico *.png *.jpg)
@@ -5633,24 +5653,24 @@ Are you really want to continue?
ProjectModel
-
+
文件已存在
-
+
文件'%1'已存在。是否删除?
-
-
+
+
删除失败
-
-
+
+
无法删除文件'%1'
@@ -5949,180 +5969,180 @@ Are you really want to continue?
无法载入自动链接设置
-
-
-
-
+
+
+
+
下列%1文件夹不存在:
-
-
+
+
二进制
-
+
未指定%1文件夹
-
+
C包含
-
-
+
+
C++包含
-
-
-
-
+
+
+
+
无法找到%1程序"%2"
-
+
C语言选项
-
+
支持所有ANSI标准C程序(-ansi)
-
+
不支持将asm、inline和typeof作为关键字(-fno-asm)
-
+
模仿传统C预处理器行为(-traditional-cpp)
-
+
代码生成
-
+
生成特定机器的专用指令(-march)
-
+
完整兼容特定机器,较少优化(-tune)
-
+
启用特定指令集(-mx)
-
+
优化级别(-Ox)
-
+
使用下列指针大小编译(-mx)
-
+
语言标准(-std)
-
+
性能分析
-
+
生成调试信息(-g3)
-
+
您同意小熊猫C++在PATH路径中寻找gcc编译器吗?
-
+
生成性能分析信息(-pg)
-
+
代码警告
-
+
忽略所有警告信息(-w)
-
+
启用常见问题警告(-Wall)
-
+
启用更多问题警告(-Wextra)
-
+
检查ISO C/C++/C++0x语法一致性(-pedantic)
-
+
只进行语法检查(不编译)(-fsyntax-only)
-
+
将警告作为错误处理(-Werror)
-
+
遇到第一个错误后立即中止编译(-Wfatal-errors)
-
+
链接器
-
+
链接Objective-C程序 (-lobjc)
-
+
不使用标准库和系统启动文件(-nostdlib)
-
+
不产生控制台窗口(-mwindows)
-
+
剥除附加信息(-s)
@@ -6131,91 +6151,91 @@ Are you really want to continue?
链接Ojbective C程序(-lobjc)
-
+
输出
-
+
在生成的汇编代码中加入注释(-fverbose-asm)
-
+
编译时使用管道而不是临时文件(-pipe)
-
+
只生成汇编代码(-S)
-
-
+
+
确认
-
+
在验证编译器设置"%1"时遇到了下列问题:
-
+
是否让小熊猫C++删除这些配置,并尝试重新建立配置?
-
+
如果仍然保留这些设置,可能会导致编译错误。<br /><br />请选择“是”,除非您清楚的知道选择“否”的后果,
-
-
+
+
未配置编译器设置。
-
+
您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2
-
+
二进制文件
-
+
库文件
-
+
C包含文件
-
+
C++包含文件
-
+
否
-
+
是
-
+
无标题
@@ -6226,22 +6246,22 @@ Are you really want to continue?
下标"%1"越界
-
+
字节
-
+
KB
-
+
MB
-
+
GB
@@ -6613,12 +6633,12 @@ Are you really want to continue?
整个单词
-
+
循环查找
-
+
正则表达式
@@ -6695,7 +6715,7 @@ Are you really want to continue?
-
+
查找
@@ -6711,8 +6731,8 @@ Are you really want to continue?
-
-
+
+
替换
@@ -6722,7 +6742,7 @@ Are you really want to continue?
在文件中替换
-
+
替换这里的"%1"?
@@ -6986,7 +7006,7 @@ Are you really want to continue?
自动链接
-
+
@@ -7062,15 +7082,15 @@ Are you really want to continue?
杂项
-
-
+
+
程序运行
-
+
试题集
@@ -7169,12 +7189,12 @@ Are you really want to continue?
SettingsWidget
-
+
载入失败
-
+
保存失败
diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp
index a2da0f1b..055e5857 100644
--- a/RedPandaIDE/compiler/compiler.cpp
+++ b/RedPandaIDE/compiler/compiler.cpp
@@ -282,6 +282,8 @@ QString Compiler::getCharsetArgument(const QByteArray& encoding)
if (compilerSet()->autoAddCharsetParams() && encoding != ENCODING_ASCII
&& compilerSet()->compilerType()!="Clang") {
QString encodingName;
+ QString execEncodingName;
+ QString compilerSetExecCharset = compilerSet()->execCharset();
QString systemEncodingName=pCharsetInfoManager->getDefaultSystemEncoding();
if (encoding == ENCODING_SYSTEM_DEFAULT) {
encodingName = systemEncodingName;
@@ -290,8 +292,14 @@ QString Compiler::getCharsetArgument(const QByteArray& encoding)
} else {
encodingName = encoding;
}
+ if (compilerSetExecCharset == ENCODING_SYSTEM_DEFAULT
+ || compilerSetExecCharset.isEmpty()) {
+ execEncodingName = systemEncodingName;
+ } else {
+ execEncodingName = compilerSetExecCharset;
+ }
result += QString(" -finput-charset=%1 -fexec-charset=%2")
- .arg(encodingName,systemEncodingName);
+ .arg(encodingName, execEncodingName);
}
return result;
}
diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp
index d3d3fef9..913e4a55 100644
--- a/RedPandaIDE/editor.cpp
+++ b/RedPandaIDE/editor.cpp
@@ -1631,6 +1631,16 @@ void Editor::deleteWord()
ExecuteCommand(SynEditorCommand::ecDeleteWord,QChar(),nullptr);
}
+void Editor::deleteToWordStart()
+{
+ ExecuteCommand(SynEditorCommand::ecDeleteWordStart,QChar(),nullptr);
+}
+
+void Editor::deleteToWordEnd()
+{
+ ExecuteCommand(SynEditorCommand::ecDeleteWordEnd,QChar(),nullptr);
+}
+
void Editor::deleteLine()
{
ExecuteCommand(SynEditorCommand::ecDeleteLine,QChar(),nullptr);
diff --git a/RedPandaIDE/editor.h b/RedPandaIDE/editor.h
index de3997ed..e2a0247f 100644
--- a/RedPandaIDE/editor.h
+++ b/RedPandaIDE/editor.h
@@ -205,6 +205,8 @@ public:
bool notParsed();
void insertLine();
void deleteWord();
+ void deleteToWordStart();
+ void deleteToWordEnd();
void deleteLine();
void duplicateLine();
void deleteToEOL();
diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp
index 535bf76c..22ce6e38 100644
--- a/RedPandaIDE/mainwindow.cpp
+++ b/RedPandaIDE/mainwindow.cpp
@@ -6160,3 +6160,21 @@ void MainWindow::on_actionInterrupt_triggered()
mDebugger->interrupt();
}
}
+
+void MainWindow::on_actionDelete_Last_Word_triggered()
+{
+ Editor *e=mEditorList->getEditor();
+ if (e) {
+ e->deleteToWordStart();
+ }
+}
+
+
+void MainWindow::on_actionDelete_to_Word_End_triggered()
+{
+ Editor *e=mEditorList->getEditor();
+ if (e) {
+ e->deleteToWordEnd();
+ }
+}
+
diff --git a/RedPandaIDE/mainwindow.h b/RedPandaIDE/mainwindow.h
index d0c7d868..fc1f0b29 100644
--- a/RedPandaIDE/mainwindow.h
+++ b/RedPandaIDE/mainwindow.h
@@ -557,6 +557,10 @@ private slots:
void on_actionInterrupt_triggered();
+ void on_actionDelete_Last_Word_triggered();
+
+ void on_actionDelete_to_Word_End_triggered();
+
private:
Ui::MainWindow *ui;
EditorList *mEditorList;
diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui
index 0cc17bcf..f53d6e81 100644
--- a/RedPandaIDE/mainwindow.ui
+++ b/RedPandaIDE/mainwindow.ui
@@ -540,7 +540,6 @@
- 50
false
@@ -1395,7 +1394,7 @@
0
0
1114
- 26
+ 25
@@ -2675,6 +2676,25 @@
Interrupt
+
+
+ Delete To Word Begin
+
+
+ Delete To Word Begin
+
+
+ Ctrl+Shift+B
+
+
+
+
+ Delete to Word End
+
+
+ Ctrl+Shift+E
+
+
diff --git a/RedPandaIDE/qsynedit/KeyStrokes.cpp b/RedPandaIDE/qsynedit/KeyStrokes.cpp
index 43c9951e..78879b5a 100644
--- a/RedPandaIDE/qsynedit/KeyStrokes.cpp
+++ b/RedPandaIDE/qsynedit/KeyStrokes.cpp
@@ -217,7 +217,7 @@ void SynEditKeyStrokes::resetDefaults()
add(SynEditorCommand::ecDeleteChar, Qt::Key_Delete, Qt::NoModifier);
add(SynEditorCommand::ecDeleteLastChar, Qt::Key_Backspace, Qt::NoModifier);
add(SynEditorCommand::ecDeleteLastChar, Qt::Key_Backspace, Qt::ShiftModifier);
- add(SynEditorCommand::ecDeleteLastWord, Qt::Key_Backspace, Qt::ControlModifier);
+ add(SynEditorCommand::ecDeleteWordStart, Qt::Key_Backspace, Qt::ControlModifier);
add(SynEditorCommand::ecUndo, Qt::Key_Backspace, Qt::AltModifier);
add(SynEditorCommand::ecRedo, Qt::Key_Backspace, Qt::AltModifier|Qt::ShiftModifier);
add(SynEditorCommand::ecLineBreak, Qt::Key_Return, Qt::NoModifier);
diff --git a/RedPandaIDE/qsynedit/KeyStrokes.h b/RedPandaIDE/qsynedit/KeyStrokes.h
index e021bbe2..4e8d4bda 100644
--- a/RedPandaIDE/qsynedit/KeyStrokes.h
+++ b/RedPandaIDE/qsynedit/KeyStrokes.h
@@ -135,8 +135,8 @@ enum class SynEditorCommand {
ecDeleteLastChar = 501, // Delete last char (i.e. backspace key)
ecDeleteChar = 502, // Delete char at cursor (i.e. delete key)
- ecDeleteWord = 503, // Delete from cursor to end of word
- ecDeleteLastWord = 504, // Delete from cursor to start of word
+ ecDeleteWordEnd = 503, // Delete from cursor to end of word
+ ecDeleteWordStart = 504, // Delete from cursor to start of word
ecDeleteBOL = 505, // Delete from cursor to beginning of line
ecDeleteEOL = 506, // Delete from cursor to end of line
ecDeleteLine = 507, // Delete current line
@@ -148,6 +148,7 @@ enum class SynEditorCommand {
ecMoveSelUp = 513, // Move selection up
ecMoveSelDown = 514, // Move selection down
ecImeStr = 550, // Insert character(s) from IME
+ ecDeleteWord = 551, // Delete current Word
ecUndo = 601, // Perform undo if available
ecRedo = 602, // Perform redo if available
diff --git a/RedPandaIDE/qsynedit/SynEdit.cpp b/RedPandaIDE/qsynedit/SynEdit.cpp
index 617ade1c..6e60382a 100644
--- a/RedPandaIDE/qsynedit/SynEdit.cpp
+++ b/RedPandaIDE/qsynedit/SynEdit.cpp
@@ -1373,8 +1373,8 @@ BufferCoord SynEdit::wordEndEx(const BufferCoord &XY)
// valid line?
if ((CY >= 1) && (CY <= mLines->count())) {
QString Line = mLines->getString(CY - 1);
- if (CX <= Line.length() && CX-2>=0) {
- if (isWordChar(Line[CX - 2]))
+ if (CX <= Line.length() && CX-1>=0) {
+ if (isWordChar(Line[CX - 1]))
CX = StrScanForNonWordChar(Line, CX);
if (CX == 0)
CX = Line.length() + 1;
@@ -2022,12 +2022,27 @@ void SynEdit::doDeleteToEOL()
deleteFromTo(caretXY(),BufferCoord{lineText().length()+1,mCaretY});
}
-void SynEdit::doDeleteLastWord()
+void SynEdit::doDeleteToWordStart()
{
if (mReadOnly)
return;
- BufferCoord start = prevWordPos();
- BufferCoord end = wordEndEx(start);
+ BufferCoord start = wordStart();
+ BufferCoord end = caretXY();
+ if (start==end) {
+ start = prevWordPos();
+ }
+ deleteFromTo(start,end);
+}
+
+void SynEdit::doDeleteToWordEnd()
+{
+ if (mReadOnly)
+ return;
+ BufferCoord start = caretXY();
+ BufferCoord end = wordEnd();
+ if (start == end) {
+ end = wordEndEx(nextWordPos());
+ }
deleteFromTo(start,end);
}
@@ -5099,8 +5114,8 @@ int SynEdit::insertTextByNormalMode(const QString &Value)
sLeftSide = GetLeftSpacing(calcIndentSpaces(caretY,s,true),true);
}
Str = sLeftSide + s;
- }
- Str = Value.mid(0, P - Start);
+ } else
+ Str = sLeftSide + Value.mid(0, P - Start);
properSetLine(caretY - 1, Str);
mLines->insertLines(caretY, CountLines(Value,P));
} else {
@@ -5426,8 +5441,11 @@ void SynEdit::ExecuteCommand(SynEditorCommand Command, QChar AChar, void *pData)
case SynEditorCommand::ecDeleteEOL:
doDeleteToEOL();
break;
- case SynEditorCommand::ecDeleteLastWord:
- doDeleteLastWord();
+ case SynEditorCommand::ecDeleteWordStart:
+ doDeleteToWordStart();
+ break;
+ case SynEditorCommand::ecDeleteWordEnd:
+ doDeleteToWordEnd();
break;
case SynEditorCommand::ecDeleteBOL:
doDeleteFromBOL();
diff --git a/RedPandaIDE/qsynedit/SynEdit.h b/RedPandaIDE/qsynedit/SynEdit.h
index 5ddfb7c4..542db9f3 100644
--- a/RedPandaIDE/qsynedit/SynEdit.h
+++ b/RedPandaIDE/qsynedit/SynEdit.h
@@ -553,7 +553,8 @@ private:
void doDeleteCurrentChar();
void doDeleteWord();
void doDeleteToEOL();
- void doDeleteLastWord();
+ void doDeleteToWordStart();
+ void doDeleteToWordEnd();
void doDeleteFromBOL();
void doDeleteLine();
void doSelecteLine();
diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp
index 8240c5d0..b2b09137 100644
--- a/RedPandaIDE/settings.cpp
+++ b/RedPandaIDE/settings.cpp
@@ -1387,6 +1387,7 @@ void Settings::Editor::setTabToSpaces(bool tabToSpaces)
Settings::CompilerSet::CompilerSet(const QString& compilerFolder):
mAutoAddCharsetParams(true),
+ mExecCharset(ENCODING_SYSTEM_DEFAULT),
mStaticLink(true)
{
if (!compilerFolder.isEmpty()) {
@@ -2307,14 +2308,14 @@ QByteArray Settings::CompilerSet::getCompilerOutput(const QString &binDir, const
return result.trimmed();
}
-const QString &Settings::CompilerSet::execCharser() const
+const QString &Settings::CompilerSet::execCharset() const
{
- return mExecCharser;
+ return mExecCharset;
}
-void Settings::CompilerSet::setExecCharser(const QString &newExecCharser)
+void Settings::CompilerSet::setExecCharset(const QString &newExecCharset)
{
- mExecCharser = newExecCharser;
+ mExecCharset = newExecCharset;
}
const QString &Settings::CompilerSet::debugServer() const
@@ -2760,7 +2761,7 @@ void Settings::CompilerSets::saveSet(int index)
mSettings->mSettings.setValue("customLinkParams", pSet->customLinkParams());
mSettings->mSettings.setValue("AddCharset", pSet->autoAddCharsetParams());
mSettings->mSettings.setValue("StaticLink", pSet->staticLink());
- mSettings->mSettings.setValue("ExecCharser", pSet->execCharser());
+ mSettings->mSettings.setValue("ExecCharset", pSet->execCharset());
// Misc. properties
mSettings->mSettings.setValue("DumpMachine", pSet->dumpMachine());
@@ -2820,13 +2821,16 @@ Settings::PCompilerSet Settings::CompilerSets::loadSet(int index)
pSet->setIniOptions(mSettings->mSettings.value("Options").toByteArray());
// Save extra 'general' options
- pSet->setUseCustomCompileParams(mSettings->mSettings.value("useCustomCompileParams").toBool());
+ pSet->setUseCustomCompileParams(mSettings->mSettings.value("useCustomCompileParams", false).toBool());
pSet->setCustomCompileParams(mSettings->mSettings.value("customCompileParams").toString());
- pSet->setUseCustomLinkParams(mSettings->mSettings.value("useCustomLinkParams").toBool());
+ pSet->setUseCustomLinkParams(mSettings->mSettings.value("useCustomLinkParams", false).toBool());
pSet->setCustomLinkParams(mSettings->mSettings.value("customLinkParams").toString());
- pSet->setAutoAddCharsetParams(mSettings->mSettings.value("AddCharset").toBool());
- pSet->setStaticLink(mSettings->mSettings.value("StaticLink").toBool());
- pSet->setExecCharser(mSettings->mSettings.value("ExecCharser").toString());
+ pSet->setAutoAddCharsetParams(mSettings->mSettings.value("AddCharset", true).toBool());
+ pSet->setStaticLink(mSettings->mSettings.value("StaticLink", false).toBool());
+ pSet->setExecCharset(mSettings->mSettings.value("ExecCharset", ENCODING_SYSTEM_DEFAULT).toString());
+ if (pSet->execCharset().isEmpty()) {
+ pSet->setExecCharset(ENCODING_SYSTEM_DEFAULT);
+ }
pSet->setDumpMachine(mSettings->mSettings.value("DumpMachine").toString());
pSet->setVersion(mSettings->mSettings.value("Version").toString());
diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h
index 62ff1c4d..baf87a47 100644
--- a/RedPandaIDE/settings.h
+++ b/RedPandaIDE/settings.h
@@ -1177,8 +1177,8 @@ public:
int compilerSetType() const;
void setCompilerSetType(int newCompilerSetType);
- const QString &execCharser() const;
- void setExecCharser(const QString &newExecCharser);
+ const QString &execCharset() const;
+ void setExecCharset(const QString &newExecCharset);
private:
// Initialization
@@ -1225,7 +1225,7 @@ public:
QString mCustomCompileParams;
QString mCustomLinkParams;
bool mAutoAddCharsetParams;
- QString mExecCharser;
+ QString mExecCharset;
bool mStaticLink;
// Options
diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
index 60f451b7..08ddb91e 100644
--- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
+++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
@@ -59,9 +59,9 @@ CompilerSetOptionWidget::~CompilerSetOptionWidget()
void CompilerSetOptionWidget::init()
{
+ ui->cbEncoding->setVisible(false);
ui->cbEncodingDetails->setVisible(false);
ui->cbEncoding->clear();
- ui->cbEncoding->addItem(tr("Auto detect"),ENCODING_AUTO_DETECT);
ui->cbEncoding->addItem(tr("ANSI"),ENCODING_SYSTEM_DEFAULT);
ui->cbEncoding->addItem(tr("UTF-8"),ENCODING_UTF8);
foreach (const QString& langName, pCharsetInfoManager->languageNames()) {
@@ -143,6 +143,26 @@ static void loadCompilerSetSettings(Settings::PCompilerSet pSet, Ui::CompilerSet
ui->txtGDBServer->setText(pSet->debugServer());
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) {
+ ui->cbEncoding->setCurrentText(pSet->execCharset());
+ ui->cbEncodingDetails->clear();
+ ui->cbEncodingDetails->setVisible(false);
+ } else {
+ QString encoding = pSet->execCharset();
+ QString language = pCharsetInfoManager->findLanguageByCharsetName(encoding);
+ ui->cbEncoding->setCurrentText(language);
+ ui->cbEncodingDetails->setVisible(true);
+ ui->cbEncodingDetails->clear();
+ QList infos = pCharsetInfoManager->findCharsetsByLanguageName(language);
+ foreach (const PCharsetInfo& info, infos) {
+ ui->cbEncodingDetails->addItem(info->name);
+ }
+ ui->cbEncodingDetails->setCurrentText(encoding);
+ }
}
void CompilerSetOptionWidget::doLoad()
@@ -198,7 +218,6 @@ void CompilerSetOptionWidget::reloadCurrentCompilerSet()
mLibDirWidget->setDirList(pSet->libDirs());
mCIncludeDirWidget->setDirList(pSet->CIncludeDirs());
mCppIncludeDirWidget->setDirList(pSet->CppIncludeDirs());
-
}
void CompilerSetOptionWidget::saveCurrentCompilerSet()
@@ -226,6 +245,12 @@ void CompilerSetOptionWidget::saveCurrentCompilerSet()
pSet->CIncludeDirs()=mCIncludeDirWidget->dirList();
pSet->CppIncludeDirs()=mCppIncludeDirWidget->dirList();
+ if (ui->cbEncodingDetails->isVisible()) {
+ pSet->setExecCharset(ui->cbEncodingDetails->currentText());
+ } else {
+ pSet->setExecCharset(ui->cbEncoding->currentText());
+ }
+
//read values in the options widget
QTabWidget* pTab = ui->optionTabs;
for (int i=0;icount();i++) {
@@ -324,3 +349,28 @@ void CompilerSetOptionWidget::updateIcons()
pIconsManager->setIcon(ui->btnChooseProfiler, IconsManager::ACTION_FILE_OPEN_FOLDER);
pIconsManager->setIcon(ui->btnChooseResourceCompiler, IconsManager::ACTION_FILE_OPEN_FOLDER);
}
+
+void CompilerSetOptionWidget::on_cbEncoding_currentTextChanged(const QString &arg1)
+{
+ QString userData = ui->cbEncoding->currentData().toString();
+ if (userData == ENCODING_AUTO_DETECT
+ || userData == ENCODING_SYSTEM_DEFAULT
+ || userData == ENCODING_UTF8) {
+ ui->cbEncodingDetails->setVisible(false);
+ ui->cbEncodingDetails->clear();
+ } else {
+ ui->cbEncodingDetails->setVisible(true);
+ ui->cbEncodingDetails->clear();
+ QList infos = pCharsetInfoManager->findCharsetsByLanguageName(userData);
+ foreach (const PCharsetInfo& info, infos) {
+ ui->cbEncodingDetails->addItem(info->name);
+ }
+ }
+}
+
+
+void CompilerSetOptionWidget::on_cbEncodingDetails_currentTextChanged(const QString &arg1)
+{
+
+}
+
diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.h b/RedPandaIDE/settingsdialog/compilersetoptionwidget.h
index 4fbba03a..0c0d4b9b 100644
--- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.h
+++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.h
@@ -61,6 +61,8 @@ private slots:
void on_btnRemoveCompilerSet_pressed();
void updateIcons();
+ void on_cbEncoding_currentTextChanged(const QString &arg1);
+ void on_cbEncodingDetails_currentTextChanged(const QString &arg1);
};
#endif // COMPILERSETOPTIONWIDGET_H