diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp index 568adcb61..5ac755b1e 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp @@ -703,8 +703,7 @@ void ScintillaEditView::setEmbeddedJSLexer() void ScintillaEditView::setJsonLexer(bool isJson5) { - LangType j = isJson5 ? L_JSON5 : L_JSON; - setLexerFromLangID(j); + setLexerFromLangID(isJson5 ? L_JSON5 : L_JSON); const TCHAR *pKwArray[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; @@ -724,15 +723,15 @@ void ScintillaEditView::setJsonLexer(bool isJson5) keywordList2 = wstring2string(kwlW, CP_ACP); } - execute(SCI_SETKEYWORDS, 0, reinterpret_cast(getCompleteKeywordList(keywordList, j, LANG_INDEX_INSTR))); - execute(SCI_SETKEYWORDS, 1, reinterpret_cast(getCompleteKeywordList(keywordList2, j, LANG_INDEX_INSTR2))); + execute(SCI_SETKEYWORDS, 0, reinterpret_cast(getCompleteKeywordList(keywordList, L_JSON, LANG_INDEX_INSTR))); + execute(SCI_SETKEYWORDS, 1, reinterpret_cast(getCompleteKeywordList(keywordList2, L_JSON, LANG_INDEX_INSTR2))); execute(SCI_SETPROPERTY, reinterpret_cast("fold"), reinterpret_cast("1")); execute(SCI_SETPROPERTY, reinterpret_cast("fold.compact"), reinterpret_cast("0")); execute(SCI_SETPROPERTY, reinterpret_cast("lexer.json.escape.sequence"), reinterpret_cast("1")); - if (j == L_JSON5) + if (isJson5) execute(SCI_SETPROPERTY, reinterpret_cast("lexer.json.allow.comments"), reinterpret_cast("1")); }