From 4a89971ee4ef65cec86652d44cf20b7d23a58ccf Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sun, 10 Jan 2016 13:32:42 +0100 Subject: [PATCH] Improvements for JSON highlighting Closes #1349 --- PowerEditor/installer/themes/Zenburn.xml | 5 +++-- PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 9 +++++++++ PowerEditor/src/langs.model.xml | 4 +++- PowerEditor/src/stylers.model.xml | 5 +++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/PowerEditor/installer/themes/Zenburn.xml b/PowerEditor/installer/themes/Zenburn.xml index 3fcb692bc..c3c7c7798 100644 --- a/PowerEditor/installer/themes/Zenburn.xml +++ b/PowerEditor/installer/themes/Zenburn.xml @@ -407,8 +407,9 @@ License: Feel free to modify this style and re-release it. This styl - - + + + diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 49c66d313..e0c4bfdf5 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -617,6 +617,15 @@ void ScintillaEditView::setJsonLexer() makeStyle(L_JSON, pKwArray); + basic_string keywordList(""); + if (pKwArray[LANG_INDEX_INSTR]) + { + basic_string kwlW = pKwArray[LANG_INDEX_INSTR]; + keywordList = wstring2string(kwlW, CP_ACP); + } + + execute(SCI_SETKEYWORDS, 0, (LPARAM)getCompleteKeywordList(keywordList, L_JSON, LANG_INDEX_INSTR)); + 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 bc7a22c40..55b3910b0 100644 --- a/PowerEditor/src/langs.model.xml +++ b/PowerEditor/src/langs.model.xml @@ -125,7 +125,9 @@ alert all anchor anchors area assign blur button checkbox clearInterval clearTimeout clientInformation close closed confirm constructor crypto decodeURI decodeURIComponent defaultStatus document element elements embed embeds encodeURI encodeURIComponent escape event fileUpload focus form forms frame innerHeight innerWidth layer layers link location mimeTypes navigate navigator frames frameRate hidden history image images offscreenBuffering open opener option outerHeight outerWidth packages pageXOffset pageYOffset parent parseFloat parseInt password pkcs11 plugin prompt propertyIsEnum radio reset screenX screenY scroll secure select self setInterval setTimeout status submit taint text textarea top unescape untaint window onblur onclick onerror onfocus onkeydown onkeypress onkeyup onmouseover onload onmouseup onmousedown onsubmit - + + false null true + ? and beep big break call cd cls color cookie1 copy debug del dim display do until exit flushkb for each next function endfunction get gets global go gosub goto if else endif md or password play quit rd redim return run select case endselect set setl setm settime shell sleep small use while loop diff --git a/PowerEditor/src/stylers.model.xml b/PowerEditor/src/stylers.model.xml index 65e3a7f7b..31bd37221 100644 --- a/PowerEditor/src/stylers.model.xml +++ b/PowerEditor/src/stylers.model.xml @@ -441,8 +441,9 @@ - - + + +