diff --git a/PowerEditor/src/ScintillaComponent/Buffer.cpp b/PowerEditor/src/ScintillaComponent/Buffer.cpp index 0604b275a..1a3d00da6 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScintillaComponent/Buffer.cpp @@ -742,7 +742,7 @@ BufferID FileManager::loadFile(const TCHAR* filename, Document doc, int encoding buf->setEncoding(-1); // if no file extension, and the language has been detected, we use the detected value - if (!newBuf->_isLargeFile && loadedFileFormat._language != L_TEXT) + if (!newBuf->_isLargeFile && ((buf->getLangType() == L_TEXT) && (loadedFileFormat._language != L_TEXT))) buf->setLangType(loadedFileFormat._language); setLoadedBufferEncodingAndEol(buf, UnicodeConvertor, loadedFileFormat._encoding, loadedFileFormat._eolFormat);