Applying language by using file extension as 1st indicator.

Applying language by using file extension as 1st indicator instead of
detection via file content.
pull/1001/head
Don Ho 2015-10-09 17:32:23 +02:00
parent 981ee5ed72
commit 34307173fb
1 changed files with 2 additions and 3 deletions

View File

@ -621,9 +621,8 @@ BufferID FileManager::loadFile(const TCHAR * filename, Document doc, int encodin
buf->setUnicodeMode(ndds._unicodeMode);
buf->setEncoding(-1);
// if a language has been detected, and the detected value is different from the file extension,
// we use the detected value
if (detectedLang != L_TEXT && detectedLang != buf->getLangType())
// if no file extension, and the language has been detected, we use the detected value
if ((buf->getLangType() == L_TEXT) && (detectedLang != L_TEXT))
buf->setLangType(detectedLang);
if (encoding == -1)