- fix: when open a file, all blank lines's indents are removed.
This commit is contained in:
parent
4797c15b04
commit
f21eded1ad
1
NEWS.md
1
NEWS.md
|
@ -18,6 +18,7 @@ Red Panda C++ Version 0.13.3
|
||||||
- add a new template for raylib shader apps
|
- add a new template for raylib shader apps
|
||||||
- fix: project files' charset settings doesn't work correctly
|
- fix: project files' charset settings doesn't work correctly
|
||||||
- enhancement: add exec charset option to compiler set settings
|
- 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
|
Red Panda C++ Version 0.13.2
|
||||||
- fix: "delete and exit" button in the environtment / folder option page doesn't work correctly
|
- fix: "delete and exit" button in the environtment / folder option page doesn't work correctly
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -556,18 +556,25 @@ void SynEditStringList::loadFromFile(const QString& filename, const QByteArray&
|
||||||
}
|
}
|
||||||
internalClear();
|
internalClear();
|
||||||
while (true) {
|
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) {
|
if (allAscii) {
|
||||||
allAscii = isTextAllAscii(line);
|
allAscii = isTextAllAscii(line);
|
||||||
}
|
}
|
||||||
if (allAscii) {
|
if (allAscii) {
|
||||||
addItem(trimRight(QString::fromLatin1(line)));
|
addItem(QString::fromLatin1(line));
|
||||||
} else {
|
} else {
|
||||||
QString newLine = codec->toUnicode(line.constData(),line.length(),&state);
|
QString newLine = codec->toUnicode(line.constData(),line.length(),&state);
|
||||||
if (state.invalidChars>0) {
|
if (state.invalidChars>0) {
|
||||||
needReread = true;
|
needReread = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
addItem(trimRight(newLine));
|
addItem(newLine);
|
||||||
}
|
}
|
||||||
if (file.atEnd()){
|
if (file.atEnd()){
|
||||||
break;
|
break;
|
||||||
|
@ -600,7 +607,14 @@ void SynEditStringList::loadFromFile(const QString& filename, const QByteArray&
|
||||||
QString line;
|
QString line;
|
||||||
internalClear();
|
internalClear();
|
||||||
while (textStream.readLineInto(&line)) {
|
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());
|
emit inserted(0,mList.count());
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="chkAutoAddCharset">
|
<widget class="QCheckBox" name="chkAutoAddCharset">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Add Charset arguments when calling the compiler</string>
|
<string>Convert Executable's Charset</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in New Issue