mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-26 07:15:21 +02:00
Apply the new file custom encoding to an opened empty file
Closes #2997, fixes #2947, fixes #1874
This commit is contained in:
parent
4c03c3eab7
commit
a9de79a550
@ -1467,6 +1467,11 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data,
|
|||||||
NppParameters *pNppParamInst = NppParameters::getInstance();
|
NppParameters *pNppParamInst = NppParameters::getInstance();
|
||||||
const NewDocDefaultSettings & ndds = (pNppParamInst->getNppGUI()).getNewDocDefaultSettings(); // for ndds._format
|
const NewDocDefaultSettings & ndds = (pNppParamInst->getNppGUI()).getNewDocDefaultSettings(); // for ndds._format
|
||||||
eolFormat = ndds._format;
|
eolFormat = ndds._format;
|
||||||
|
//for empty files, set the encoding to the default for new files
|
||||||
|
if (fileSize == 0)
|
||||||
|
{
|
||||||
|
encoding = ndds._unicodeMode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user