From d5c0ef2c77f75a6022f932c4391fd7ac4bdf3f20 Mon Sep 17 00:00:00 2001 From: Oirfeodent Date: Wed, 21 Aug 2019 20:50:24 +0530 Subject: [PATCH] Increase Keyword Set for the adaptation of new updated Scintilla This will enable languages having more than 7 keyword sets to use it. "You can set up to 9 lists of keywords for use by the current lexer. keyWordSet can be 0 to 8" : https://www.scintilla.org/ScintillaDoc.html#SCI_SETKEYWORDS Fix #6020, close #6081 --- PowerEditor/src/Parameters.cpp | 2 ++ PowerEditor/src/Parameters.h | 2 ++ .../src/ScitillaComponent/ScintillaEditView.cpp | 13 +++++++++++++ .../src/ScitillaComponent/ScintillaEditView.h | 2 ++ 4 files changed, 19 insertions(+) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 9804b87e..900692ec 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -550,6 +550,8 @@ int getKwClassFromName(const TCHAR *str) if (!lstrcmp(TEXT("type3"), str)) return LANG_INDEX_TYPE3; if (!lstrcmp(TEXT("type4"), str)) return LANG_INDEX_TYPE4; if (!lstrcmp(TEXT("type5"), str)) return LANG_INDEX_TYPE5; + if (!lstrcmp(TEXT("type6"), str)) return LANG_INDEX_TYPE6; + if (!lstrcmp(TEXT("type7"), str)) return LANG_INDEX_TYPE7; if ((str[1] == '\0') && (str[0] >= '0') && (str[0] <= '8')) // up to KEYWORDSET_MAX return str[0] - '0'; diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index fb7688fa..03028df1 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -99,6 +99,8 @@ const int LANG_INDEX_TYPE2 = 3; const int LANG_INDEX_TYPE3 = 4; const int LANG_INDEX_TYPE4 = 5; const int LANG_INDEX_TYPE5 = 6; +const int LANG_INDEX_TYPE6 = 7; +const int LANG_INDEX_TYPE7 = 8; const int COPYDATA_PARAMS = 0; const int COPYDATA_FILENAMESA = 1; diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 80c6e9b7..dc419cf0 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1226,6 +1226,19 @@ void ScintillaEditView::setLexer(int lexerID, LangType langType, int whichList) const char * keyWords_char = wmc.wchar2char(pKwArray[LANG_INDEX_TYPE5], CP_ACP); setKeywords(langType, keyWords_char, LANG_INDEX_TYPE5); } + + if (whichList & LIST_7) + { + const char * keyWords_char = wmc.wchar2char(pKwArray[LANG_INDEX_TYPE6], CP_ACP); + setKeywords(langType, keyWords_char, LANG_INDEX_TYPE6); + } + + if (whichList & LIST_8) + { + const char * keyWords_char = wmc.wchar2char(pKwArray[LANG_INDEX_TYPE7], CP_ACP); + setKeywords(langType, keyWords_char, LANG_INDEX_TYPE7); + } + execute(SCI_SETPROPERTY, reinterpret_cast("fold"), reinterpret_cast("1")); execute(SCI_SETPROPERTY, reinterpret_cast("fold.compact"), reinterpret_cast("0")); execute(SCI_SETPROPERTY, reinterpret_cast("fold.comment"), reinterpret_cast("1")); diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 0382c690..ba233167 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -95,6 +95,8 @@ const int CP_GREEK = 1253; #define LIST_4 16 #define LIST_5 32 #define LIST_6 64 +#define LIST_7 128 +#define LIST_8 256 const bool fold_uncollapse = true; const bool fold_collapse = false;