From 8ac0aba68eed9fb37e75566be0b831ef5d79042d Mon Sep 17 00:00:00 2001 From: Frank Fesevur Date: Wed, 21 Oct 2015 11:40:31 +0200 Subject: [PATCH] Improve the language detection at the beginning of file content * The Shebang detection is much improved: - detect more languages - not tied to any specific full path - See https://en.wikipedia.org/wiki/Shebang_%28Unix%29 for more details about Shebang * There is not need to have a space after in the html doctype to support older * versions of html as well --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 97 ++++++++++---------- 1 file changed, 46 insertions(+), 51 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 550e7f788..2e1a5e1ab 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -1253,17 +1253,14 @@ int FileManager::detectCodepage(char* buf, size_t len) LangType FileManager::detectLanguageFromTextBegining(const unsigned char *data, unsigned int dataLen) { - // it detectes xml, php and bash script file - std::string xmlHeader = ""; // length : 6 - std::string htmlHeader1 = "