- 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);
|
||||
- enhancement: highlighter for GLSL (OpenGL Shading Language)
|
||||
- add a new template for raylib shader apps
|
||||
- fix: project files' charset settings doesn't work correctly
|
||||
|
||||
Red Panda C++ Version 0.13.2
|
||||
- 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;
|
||||
}
|
||||
void Editor::setEncodingOption(const QByteArray& encoding) noexcept{
|
||||
if (mEncodingOption == encoding)
|
||||
return;
|
||||
mEncodingOption = encoding;
|
||||
if (!isNew())
|
||||
loadFile();
|
||||
|
|
|
@ -980,7 +980,8 @@ void MainWindow::openFile(const QString &filename, QTabWidget* page)
|
|||
unit = mProject->findUnitByFilename(filename);
|
||||
}
|
||||
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);
|
||||
if (mProject) {
|
||||
mProject->associateEditorToUnit(editor,unit);
|
||||
|
@ -2011,7 +2012,8 @@ void MainWindow::loadLastOpens()
|
|||
unit = mProject->findUnitByFilename(editorFilename);
|
||||
}
|
||||
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) {
|
||||
mProject->associateEditorToUnit(editor,unit);
|
||||
}
|
||||
|
|
|
@ -1760,7 +1760,12 @@ const QByteArray &ProjectUnit::encoding() const
|
|||
|
||||
void ProjectUnit::setEncoding(const QByteArray &newEncoding)
|
||||
{
|
||||
if (mEncoding != newEncoding) {
|
||||
if (mEditor) {
|
||||
mEditor->setEncodingOption(newEncoding);
|
||||
}
|
||||
mEncoding = newEncoding;
|
||||
}
|
||||
}
|
||||
|
||||
bool ProjectUnit::modified() const
|
||||
|
|
Loading…
Reference in New Issue