mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 22:04:55 +02:00
Merge remote-tracking branch 'remotes/g3candy/master'
This commit is contained in:
commit
ae7c93305a
@ -630,11 +630,11 @@ BufferID FileManager::loadFile(const TCHAR * filename, Document doc, int encodin
|
|||||||
// 3 formats : WIN_FORMAT, UNIX_FORMAT and MAC_FORMAT
|
// 3 formats : WIN_FORMAT, UNIX_FORMAT and MAC_FORMAT
|
||||||
if (nullptr != UnicodeConvertor.getNewBuf())
|
if (nullptr != UnicodeConvertor.getNewBuf())
|
||||||
{
|
{
|
||||||
FormatType format = getEOLFormatForm(UnicodeConvertor.getNewBuf(), UnicodeConvertor.getNewSize());
|
FormatType format = getEOLFormatForm(UnicodeConvertor.getNewBuf(), UnicodeConvertor.getNewSize(),ndds._format);
|
||||||
buf->setFormat(format);
|
buf->setFormat(format);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
buf->setFormat(FormatType::osdefault);
|
buf->setFormat(ndds._format);
|
||||||
|
|
||||||
UniMode um = UnicodeConvertor.getEncoding();
|
UniMode um = UnicodeConvertor.getEncoding();
|
||||||
if (um == uni7Bit)
|
if (um == uni7Bit)
|
||||||
@ -681,13 +681,17 @@ bool FileManager::reloadBuffer(BufferID id)
|
|||||||
{
|
{
|
||||||
if (encoding == -1)
|
if (encoding == -1)
|
||||||
{
|
{
|
||||||
|
NppParameters *pNppParamInst = NppParameters::getInstance();
|
||||||
|
const NewDocDefaultSettings & ndds = (pNppParamInst->getNppGUI()).getNewDocDefaultSettings(); // for ndds._format
|
||||||
|
|
||||||
if (nullptr != UnicodeConvertor.getNewBuf())
|
if (nullptr != UnicodeConvertor.getNewBuf())
|
||||||
{
|
{
|
||||||
FormatType format = getEOLFormatForm(UnicodeConvertor.getNewBuf(), UnicodeConvertor.getNewSize());
|
FormatType format = getEOLFormatForm(UnicodeConvertor.getNewBuf(), UnicodeConvertor.getNewSize(),ndds._format);
|
||||||
buf->setFormat(format);
|
buf->setFormat(format);
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
buf->setFormat(FormatType::osdefault);
|
buf->setFormat(ndds._format);
|
||||||
|
}
|
||||||
|
|
||||||
buf->setUnicodeMode(UnicodeConvertor.getEncoding());
|
buf->setUnicodeMode(UnicodeConvertor.getEncoding());
|
||||||
}
|
}
|
||||||
@ -1484,7 +1488,17 @@ inline bool FileManager::loadFileData(Document doc, const TCHAR * filename, char
|
|||||||
|
|
||||||
// broadcast the format
|
// broadcast the format
|
||||||
if (pFormat != nullptr)
|
if (pFormat != nullptr)
|
||||||
*pFormat = (format != FormatType::unknown) ? format : FormatType::osdefault;
|
{
|
||||||
|
if (format == FormatType::unknown){
|
||||||
|
NppParameters *pNppParamInst = NppParameters::getInstance();
|
||||||
|
const NewDocDefaultSettings & ndds = (pNppParamInst->getNppGUI()).getNewDocDefaultSettings(); // for ndds._format
|
||||||
|
*pFormat = ndds._format;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*pFormat = format;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_pscratchTilla->execute(SCI_EMPTYUNDOBUFFER);
|
_pscratchTilla->execute(SCI_EMPTYUNDOBUFFER);
|
||||||
_pscratchTilla->execute(SCI_SETSAVEPOINT);
|
_pscratchTilla->execute(SCI_SETSAVEPOINT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user