- fix: project files' charset settings doesn't work correctly
This commit is contained in:
parent
d9f36ae3cd
commit
722d02d688
1
NEWS.md
1
NEWS.md
|
@ -16,6 +16,7 @@ Red Panda C++ Version 0.13.3
|
||||||
- fix: Undo in the editor will lose line indents when no highlighter is assigned (the editing file is a not c/cpp source file);
|
- fix: Undo in the editor will lose line indents when no highlighter is assigned (the editing file is a not c/cpp source file);
|
||||||
- enhancement: highlighter for GLSL (OpenGL Shading Language)
|
- enhancement: highlighter for GLSL (OpenGL Shading Language)
|
||||||
- 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
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -394,6 +394,8 @@ const QByteArray& Editor::encodingOption() const noexcept{
|
||||||
return mEncodingOption;
|
return mEncodingOption;
|
||||||
}
|
}
|
||||||
void Editor::setEncodingOption(const QByteArray& encoding) noexcept{
|
void Editor::setEncodingOption(const QByteArray& encoding) noexcept{
|
||||||
|
if (mEncodingOption == encoding)
|
||||||
|
return;
|
||||||
mEncodingOption = encoding;
|
mEncodingOption = encoding;
|
||||||
if (!isNew())
|
if (!isNew())
|
||||||
loadFile();
|
loadFile();
|
||||||
|
|
|
@ -980,7 +980,8 @@ void MainWindow::openFile(const QString &filename, QTabWidget* page)
|
||||||
unit = mProject->findUnitByFilename(filename);
|
unit = mProject->findUnitByFilename(filename);
|
||||||
}
|
}
|
||||||
bool inProject = (mProject && unit);
|
bool inProject = (mProject && unit);
|
||||||
editor = mEditorList->newEditor(filename,ENCODING_AUTO_DETECT,
|
QByteArray encoding = unit ? unit->encoding() : ENCODING_AUTO_DETECT;
|
||||||
|
editor = mEditorList->newEditor(filename,encoding,
|
||||||
inProject, false, page);
|
inProject, false, page);
|
||||||
if (mProject) {
|
if (mProject) {
|
||||||
mProject->associateEditorToUnit(editor,unit);
|
mProject->associateEditorToUnit(editor,unit);
|
||||||
|
@ -2011,7 +2012,8 @@ void MainWindow::loadLastOpens()
|
||||||
unit = mProject->findUnitByFilename(editorFilename);
|
unit = mProject->findUnitByFilename(editorFilename);
|
||||||
}
|
}
|
||||||
bool inProject = (mProject && unit);
|
bool inProject = (mProject && unit);
|
||||||
Editor * editor = mEditorList->newEditor(editorFilename,ENCODING_AUTO_DETECT,inProject,false,page);
|
QByteArray encoding = unit ? unit->encoding() : ENCODING_AUTO_DETECT;
|
||||||
|
Editor * editor = mEditorList->newEditor(editorFilename, encoding, inProject,false,page);
|
||||||
if (mProject) {
|
if (mProject) {
|
||||||
mProject->associateEditorToUnit(editor,unit);
|
mProject->associateEditorToUnit(editor,unit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1760,8 +1760,13 @@ const QByteArray &ProjectUnit::encoding() const
|
||||||
|
|
||||||
void ProjectUnit::setEncoding(const QByteArray &newEncoding)
|
void ProjectUnit::setEncoding(const QByteArray &newEncoding)
|
||||||
{
|
{
|
||||||
|
if (mEncoding != newEncoding) {
|
||||||
|
if (mEditor) {
|
||||||
|
mEditor->setEncodingOption(newEncoding);
|
||||||
|
}
|
||||||
mEncoding = newEncoding;
|
mEncoding = newEncoding;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool ProjectUnit::modified() const
|
bool ProjectUnit::modified() const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue