diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index cf5523f9..dc70dcb9 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -629,7 +629,7 @@ BEGIN MENUITEM "Caml", IDM_LANG_CAML MENUITEM "Cmake", IDM_LANG_CMAKE MENUITEM "COBOL", IDM_LANG_COBOL - MENUITEM "Coffee script", IDM_LANG_COFFEESCRIPT + MENUITEM "CoffeeScript", IDM_LANG_COFFEESCRIPT MENUITEM "CSS", IDM_LANG_CSS MENUITEM "D", IDM_LANG_D MENUITEM "Diff", IDM_LANG_DIFF @@ -696,7 +696,7 @@ BEGIN MENUITEM "Caml", IDM_LANG_CAML MENUITEM "Cmake", IDM_LANG_CMAKE MENUITEM "COBOL", IDM_LANG_COBOL - MENUITEM "Coffee script", IDM_LANG_COFFEESCRIPT + MENUITEM "CoffeeScript", IDM_LANG_COFFEESCRIPT MENUITEM "CSS", IDM_LANG_CSS END POPUP "D" diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index b8f5e383..fb2ab319 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -131,7 +131,7 @@ LanguageName ScintillaEditView::langNames[L_EXTERNAL+1] = { {TEXT("powershell"), TEXT("PowerShell"), TEXT("Windows PowerShell"), L_POWERSHELL, SCLEX_POWERSHELL}, {TEXT("r"), TEXT("R"), TEXT("R programming language"), L_R, SCLEX_R}, {TEXT("jsp"), TEXT("JSP"), TEXT("JavaServer Pages script file"), L_JSP, SCLEX_HTML}, -{TEXT("coffeeScript"), TEXT("Coffee Script"), TEXT("Coffee script file"), L_COFFEESCRIPT, SCLEX_COFFEESCRIPT}, +{TEXT("coffeescript"), TEXT("CoffeeScript"), TEXT("CoffeeScript file"), L_COFFEESCRIPT, SCLEX_COFFEESCRIPT}, {TEXT("ext"), TEXT("External"), TEXT("External"), L_EXTERNAL, SCLEX_NULL} }; @@ -204,14 +204,7 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere) showMargin(_SC_MARGE_FOLDER, true); execute(SCI_SETMARGINMASKN, _SC_MARGE_SYBOLE, (1<wchar2char(styleToSet._fontName, CP_ACP); execute(SCI_STYLESETFONT, (WPARAM)styleID, (LPARAM)fontNameA); -#else - execute(SCI_STYLESETFONT, (WPARAM)styleID, (LPARAM)styleToSet._fontName); -#endif } int fontStyle = styleToSet._fontStyle; if (fontStyle != STYLE_NOT_USED) @@ -535,13 +524,9 @@ void ScintillaEditView::setXmlLexer(LangType type) execute(SCI_SETLEXER, SCLEX_HTML); const TCHAR *htmlKeyWords_generic =_pParameter->getWordList(L_HTML, LANG_INDEX_INSTR); -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); const char *htmlKeyWords = wmc->wchar2char(htmlKeyWords_generic, CP_ACP); execute(SCI_SETKEYWORDS, 0, reinterpret_cast(htmlKeyWords?htmlKeyWords:"")); -#else - execute(SCI_SETKEYWORDS, 0, reinterpret_cast(htmlKeyWords_generic?htmlKeyWords_generic:"")); -#endif makeStyle(L_HTML); setEmbeddedJSLexer(); @@ -563,12 +548,8 @@ void ScintillaEditView::setEmbeddedJSLexer() basic_string keywordList(""); if (pKwArray[LANG_INDEX_INSTR]) { -#ifdef UNICODE basic_string kwlW = pKwArray[LANG_INDEX_INSTR]; keywordList = wstring2string(kwlW, CP_ACP); -#else - keywordList = pKwArray[LANG_INDEX_INSTR]; -#endif } execute(SCI_SETKEYWORDS, 1, (LPARAM)getCompleteKeywordList(keywordList, L_JS, LANG_INDEX_INSTR)); @@ -585,12 +566,8 @@ void ScintillaEditView::setEmbeddedPhpLexer() basic_string keywordList(""); if (pKwArray[LANG_INDEX_INSTR]) { -#ifdef UNICODE basic_string kwlW = pKwArray[LANG_INDEX_INSTR]; keywordList = wstring2string(kwlW, CP_ACP); -#else - keywordList = pKwArray[LANG_INDEX_INSTR]; -#endif } execute(SCI_SETKEYWORDS, 4, (LPARAM)getCompleteKeywordList(keywordList, L_PHP, LANG_INDEX_INSTR)); @@ -607,12 +584,8 @@ void ScintillaEditView::setEmbeddedAspLexer() basic_string keywordList(""); if (pKwArray[LANG_INDEX_INSTR]) { -#ifdef UNICODE basic_string kwlW = pKwArray[LANG_INDEX_INSTR]; keywordList = wstring2string(kwlW, CP_ACP); -#else - keywordList = pKwArray[LANG_INDEX_INSTR]; -#endif } execute(SCI_SETKEYWORDS, 2, (LPARAM)getCompleteKeywordList(keywordList, L_VB, LANG_INDEX_INSTR)); @@ -658,12 +631,9 @@ void ScintillaEditView::setUserLexer(const TCHAR *userLangName) for (int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; ++i) { -#ifndef UNICODE - const char * keyWords_char = userLangContainer->_keywordLists[i]; -#else WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); const char * keyWords_char = wmc->wchar2char(userLangContainer->_keywordLists[i], codepage); -#endif + if (globalMappper().setLexerMapper.find(i) != globalMappper().setLexerMapper.end()) { execute(SCI_SETPROPERTY, (WPARAM)globalMappper().setLexerMapper[i].c_str(), reinterpret_cast(keyWords_char)); @@ -758,12 +728,9 @@ void ScintillaEditView::setExternalLexer(LangType typeDoc) int id = typeDoc - L_EXTERNAL; TCHAR * name = NppParameters::getInstance()->getELCFromIndex(id)._name; -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); const char *pName = wmc->wchar2char(name, CP_ACP); -#else - const char *pName = name; -#endif + execute(SCI_SETLEXERLANGUAGE, 0, (LPARAM)pName); LexerStyler *pStyler = (_pParameter->getLStylerArray()).getLexerStylerByName(name); @@ -780,11 +747,7 @@ void ScintillaEditView::setExternalLexer(LangType typeDoc) basic_string keywordList(""); if (style._keywords) { -#ifdef UNICODE keywordList = wstring2string(*(style._keywords), CP_ACP); -#else - keywordList = *(style._keywords); -#endif } execute(SCI_SETKEYWORDS, style._keywordClass, (LPARAM)getCompleteKeywordList(keywordList, typeDoc, style._keywordClass)); } @@ -806,13 +769,9 @@ void ScintillaEditView::setCppLexer(LangType langType) { if (doxygenKeyWords) { -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); const char * doxygenKeyWords_char = wmc->wchar2char(doxygenKeyWords, CP_ACP); execute(SCI_SETKEYWORDS, 2, (LPARAM)doxygenKeyWords_char); -#else - execute(SCI_SETKEYWORDS, 2, (LPARAM)doxygenKeyWords); -#endif } } @@ -856,23 +815,15 @@ void ScintillaEditView::setCppLexer(LangType langType) basic_string keywordListType(""); if (pKwArray[LANG_INDEX_INSTR]) { -#ifdef UNICODE basic_string kwlW = pKwArray[LANG_INDEX_INSTR]; keywordListInstruction = wstring2string(kwlW, CP_ACP); -#else - keywordListInstruction = pKwArray[LANG_INDEX_INSTR]; -#endif } cppInstrs = getCompleteKeywordList(keywordListInstruction, langType, LANG_INDEX_INSTR); if (pKwArray[LANG_INDEX_TYPE]) { -#ifdef UNICODE basic_string kwlW = pKwArray[LANG_INDEX_TYPE]; keywordListType = wstring2string(kwlW, CP_ACP); -#else - keywordListType = pKwArray[LANG_INDEX_TYPE]; -#endif } cppTypes = getCompleteKeywordList(keywordListType, langType, LANG_INDEX_TYPE); @@ -905,23 +856,15 @@ void ScintillaEditView::setTclLexer() basic_string keywordListType(""); if (pKwArray[LANG_INDEX_INSTR]) { -#ifdef UNICODE basic_string kwlW = pKwArray[LANG_INDEX_INSTR]; keywordListInstruction = wstring2string(kwlW, CP_ACP); -#else - keywordListInstruction = pKwArray[LANG_INDEX_INSTR]; -#endif } tclInstrs = getCompleteKeywordList(keywordListInstruction, L_TCL, LANG_INDEX_INSTR); if (pKwArray[LANG_INDEX_TYPE]) { -#ifdef UNICODE basic_string kwlW = pKwArray[LANG_INDEX_TYPE]; keywordListType = wstring2string(kwlW, CP_ACP); -#else - keywordListType = pKwArray[LANG_INDEX_TYPE]; -#endif } tclTypes = getCompleteKeywordList(keywordListType, L_TCL, LANG_INDEX_TYPE); @@ -941,33 +884,21 @@ void ScintillaEditView::setObjCLexer(LangType langType) basic_string objcInstr1Kwl(""); if (pKwArray[LANG_INDEX_INSTR]) { -#ifdef UNICODE objcInstr1Kwl = wstring2string(pKwArray[LANG_INDEX_INSTR], CP_ACP); -#else - objcInstr1Kwl = pKwArray[LANG_INDEX_INSTR]; -#endif } const char *objcInstrs = getCompleteKeywordList(objcInstr1Kwl, langType, LANG_INDEX_INSTR); basic_string objcInstr2Kwl(""); if (pKwArray[LANG_INDEX_INSTR2]) { -#ifdef UNICODE objcInstr2Kwl = wstring2string(pKwArray[LANG_INDEX_INSTR2], CP_ACP); -#else - objcInstr2Kwl = pKwArray[LANG_INDEX_INSTR2]; -#endif } const char *objCDirective = getCompleteKeywordList(objcInstr2Kwl, langType, LANG_INDEX_INSTR2); basic_string objcTypeKwl(""); if (pKwArray[LANG_INDEX_TYPE]) { -#ifdef UNICODE objcTypeKwl = wstring2string(pKwArray[LANG_INDEX_TYPE], CP_ACP); -#else - objcTypeKwl = pKwArray[LANG_INDEX_TYPE]; -#endif } const char *objcTypes = getCompleteKeywordList(objcTypeKwl, langType, LANG_INDEX_TYPE); @@ -975,23 +906,16 @@ void ScintillaEditView::setObjCLexer(LangType langType) basic_string objcType2Kwl(""); if (pKwArray[LANG_INDEX_TYPE2]) { -#ifdef UNICODE objcType2Kwl = wstring2string(pKwArray[LANG_INDEX_TYPE2], CP_ACP); -#else - objcType2Kwl = pKwArray[LANG_INDEX_TYPE2]; -#endif } const char *objCQualifier = getCompleteKeywordList(objcType2Kwl, langType, LANG_INDEX_TYPE2); const TCHAR *doxygenKeyWords_generic = _pParameter->getWordList(L_CPP, LANG_INDEX_TYPE2); const char * doxygenKeyWords; basic_string doxygenKeyWordsString(""); -#ifdef UNICODE - doxygenKeyWordsString = wstring2string(doxygenKeyWords_generic, CP_ACP); - doxygenKeyWords = doxygenKeyWordsString.c_str(); -#else - doxygenKeyWords = doxygenKeyWords_generic; -#endif + doxygenKeyWordsString = wstring2string(doxygenKeyWords_generic, CP_ACP); + doxygenKeyWords = doxygenKeyWordsString.c_str(); + execute(SCI_SETKEYWORDS, 0, (LPARAM)objcInstrs); execute(SCI_SETKEYWORDS, 1, (LPARAM)objcTypes); execute(SCI_SETKEYWORDS, 2, (LPARAM)doxygenKeyWords); @@ -1020,78 +944,48 @@ void ScintillaEditView::setLexer(int lexerID, LangType langType, int whichList) makeStyle(langType, pKwArray); -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); -#endif if (whichList & LIST_0) { -#ifdef UNICODE const char * keyWords_char = wmc->wchar2char(pKwArray[LANG_INDEX_INSTR], CP_ACP); setKeywords(langType, keyWords_char, LANG_INDEX_INSTR); -#else - setKeywords(langType, pKwArray[LANG_INDEX_INSTR], LANG_INDEX_INSTR); -#endif } if (whichList & LIST_1) { -#ifdef UNICODE const char * keyWords_char = wmc->wchar2char(pKwArray[LANG_INDEX_INSTR2], CP_ACP); setKeywords(langType, keyWords_char, LANG_INDEX_INSTR2); -#else - setKeywords(langType, pKwArray[LANG_INDEX_INSTR2], LANG_INDEX_INSTR2); -#endif } if (whichList & LIST_2) { -#ifdef UNICODE const char * keyWords_char = wmc->wchar2char(pKwArray[LANG_INDEX_TYPE], CP_ACP); setKeywords(langType, keyWords_char, LANG_INDEX_TYPE); -#else - setKeywords(langType, pKwArray[LANG_INDEX_TYPE], LANG_INDEX_TYPE); -#endif } if (whichList & LIST_3) { -#ifdef UNICODE const char * keyWords_char = wmc->wchar2char(pKwArray[LANG_INDEX_TYPE2], CP_ACP); setKeywords(langType, keyWords_char, LANG_INDEX_TYPE2); -#else - setKeywords(langType, pKwArray[LANG_INDEX_TYPE2], LANG_INDEX_TYPE2); -#endif } if (whichList & LIST_4) { -#ifdef UNICODE const char * keyWords_char = wmc->wchar2char(pKwArray[LANG_INDEX_TYPE3], CP_ACP); setKeywords(langType, keyWords_char, LANG_INDEX_TYPE3); -#else - setKeywords(langType, pKwArray[LANG_INDEX_TYPE3], LANG_INDEX_TYPE3); -#endif } if (whichList & LIST_5) { -#ifdef UNICODE const char * keyWords_char = wmc->wchar2char(pKwArray[LANG_INDEX_TYPE4], CP_ACP); setKeywords(langType, keyWords_char, LANG_INDEX_TYPE4); -#else - setKeywords(langType, pKwArray[LANG_INDEX_TYPE4], LANG_INDEX_TYPE4); -#endif } if (whichList & LIST_6) { -#ifdef UNICODE const char * keyWords_char = wmc->wchar2char(pKwArray[LANG_INDEX_TYPE5], CP_ACP); setKeywords(langType, keyWords_char, LANG_INDEX_TYPE5); -#else - setKeywords(langType, pKwArray[LANG_INDEX_TYPE5], LANG_INDEX_TYPE5); -#endif } execute(SCI_SETPROPERTY, reinterpret_cast("fold"), reinterpret_cast("1")); execute(SCI_SETPROPERTY, reinterpret_cast("fold.compact"), reinterpret_cast("0")); diff --git a/PowerEditor/src/langs.model.xml b/PowerEditor/src/langs.model.xml index 43c67b02..7fd93858 100644 --- a/PowerEditor/src/langs.model.xml +++ b/PowerEditor/src/langs.model.xml @@ -55,6 +55,11 @@ accept add alter apply assign call chain close compute continue control convert count delete display divide draw drop eject else enable end-accept end-add end-call end-chain end-compute end-delete end-display end-divide end-evaluate end-if end-invoke end-multiply end-perform end-read end-receive end-return end-rewrite end-search end-start end-string end-subtract end-unstring end-write erase evaluate examine exec execute exit go goback generate if ignore initialize initiate insert inspect invoke leave merge move multiply open otherwise perform print read receive release reload replace report reread rerun reserve reset return rewind rewrite rollback run search seek select send set sort start stop store string subtract sum suppress terminate then transform unlock unstring update use wait when wrap write access acquire actual address advancing after all allowing alphabet alphabetic alphabetic-lower alphabetic-upper alphanumeric alphanumeric-edited also alternate and any are area areas as ascending at attribute author auto auto-hyphen-skip auto-skip automatic autoterminate background-color background-colour backward basis beep before beginning bell binary blank blink blinking block bold bottom box boxed by c01 c02 c03 c04 c05 c06 c07 c08 c09 c10 c11 c12 cancel cbl cd centered cf ch chaining changed character characters chart class clock-units cobol code code-set col collating color colour column com-reg comma command-line commit commitment common communication comp comp-0 comp-1 comp-2 comp-3 comp-4 comp-5 comp-6 comp-x compression computational computational-1 computational-2 computational-3 computational-4 computational-5 computational-6 computational-x computational console contains content control-area controls conversion converting core-index corr corresponding crt crt-under csp currency current-date cursor cycle cyl-index cyl-overflow date date-compiled date-written day day-of-week dbcs de debug debug-contents debug-item debug-line debug-name debug-sub-1 debug-sub-2 debug-sub-3 debugging decimal-point default delimited delimiter depending descending destination detail disable disk disp display-1 display-st down duplicates dynamic echo egcs egi emi empty-check encryption end end-of-page ending enter entry eol eop eos equal equals error escape esi every exceeds exception excess-3 exclusive exhibit extend extended-search external externally-described-key factory false fd fh--fcd fh--keydef file-id file-limit file-limits file-prefix filler final first fixed footing for foreground-color foreground-colour footing format from full giving global greater grid group heading high high-value high-values highlight id in index indexed indic indicate indicator indicators inheriting initial installation into invalid invoked is japanese just justified kanji kept key keyboard label last leading left left-justify leftline length length-check less limit limits lin linage linage-counter line line-counter lines lock lock-holding locking low low-value low-values lower lowlight manual mass-update master-index memory message method mode modified modules more-labels multiple name named national national-edited native nchar negative next no no-echo nominal not note nstd-reels null nulls number numeric numeric-edited numeric-fill o-fill object object-computer object-storage occurs of off omitted on oostackptr optional or order organization other others overflow overline packed-decimal padding page page-counter packed-decimal paragraph password pf ph pic picture plus pointer pop-up pos position positioning positive previous print-control print-switch printer printer-1 printing prior private procedure-pointer procedures proceed process processing prompt protected public purge queue quote quotes random range rd readers ready record record-overflow recording records redefines reel reference references relative remainder remarks removal renames reorg-criteria repeated replacing reporting reports required resident return-code returning reverse reverse-video reversed rf rh right right-justify rolling rounded s01 s02 s03 s04 s05 same screen scroll sd secure security segment segment-limit selective self selfclass sentence separate sequence sequential service setshadow shift-in shift-out sign size skip1 skip2 skip3 sort-control sort-core-size sort-file-size sort-merge sort-message sort-mode-size sort-option sort-return source source-computer space spaces space-fill spaces standard standard-1 standard-2 starting status sub-queue-1 sub-queue-2 sub-queue-3 subfile super symbolic sync synchronized sysin sysipt syslst sysout syspch syspunch system-info tab tallying tape terminal terminal-info test text than through thru time time-of-day time-out timeout times title to top totaled totaling trace track-area track-limit tracks trailing trailing-sign transaction true type typedef underline underlined unequal unit until up updaters upon upper upsi-0 upsi-1 upsi-2 upsi-3 upsi-4 upsi-5 upsi-6 upsi-7 usage user using value values variable varying when-compiled window with words write-only write-verify writerszero zero zero-fill zeros zeroes + + new instanceof do return break continue throw for while until loop if else unless switch when then in of by typeof delete where try catch finally prototype jQuery case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf + Object Number Boolean Array String RegExp Function Date Math eval setInterval clearInterval setTimeout clearTimeout isFinite isNaN parseFloat parseInt escape unescape console encodeURI encodeURIComponent decodeURI decodeURIComponent window document navigator location history screen alert prompt process GLOBAL require exports + false true yes no on off undefined null NaN Infinity + alignof and and_eq bitand bitor break case catch compl const_cast continue default delete do dynamic_cast else false for goto if namespace new not not_eq nullptr operator or or_eq reinterpret_cast return sizeof static_assert static_cast switch this throw true try typedef typeid using while xor xor_eq NULL alignas asm auto bool char char16_t char32_t class const constexpr decltype double enum explicit export extern final float friend inline int long mutable noexcept override private protected public register short signed static struct template thread_local typename union unsigned virtual void volatile wchar_t diff --git a/PowerEditor/src/stylers.model.xml b/PowerEditor/src/stylers.model.xml index 1fa16eeb..d591e2ac 100644 --- a/PowerEditor/src/stylers.model.xml +++ b/PowerEditor/src/stylers.model.xml @@ -189,21 +189,6 @@ - - - - - - - - - - - - - - - @@ -221,6 +206,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -774,24 +796,6 @@ - - - - - - - - - - - - - - - - - -