From af0bc2e113f4398ecf3104052a6fb23ffd9e3aef Mon Sep 17 00:00:00 2001 From: Don Ho Date: Wed, 5 Oct 2022 00:06:57 +0200 Subject: [PATCH] Revert "Fix detected language not being applied issue" This reverts commit 6263ce5dece595543bbfaa4207391075ae3a212a for fixing the regression. Fix #12226, fix #12253 --- PowerEditor/src/ScintillaComponent/Buffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);