From 8eabc8a3ca80a21cc6ae2fd901a628015e65132f Mon Sep 17 00:00:00 2001 From: Aleksey Dobrunov Date: Fri, 22 Oct 2021 23:35:08 +0500 Subject: [PATCH] "Users file of schemes" may contain path to folder of hrc files. --- docs/history.ru.txt | 3 +++ external/colorer | 2 +- misc/colorere.hlf | 2 +- misc/colorerr.hlf | 2 +- src/FarEditorSet.cpp | 16 +++++----------- src/version.h | 2 +- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/docs/history.ru.txt b/docs/history.ru.txt index d3fc4e4..d4b0244 100644 --- a/docs/history.ru.txt +++ b/docs/history.ru.txt @@ -1,6 +1,9 @@  История изменений FarColorer. Информацию, об изменениях в библиотеке схем (базах) смотрите в файле base\CHANGELOG.md +Версия 1.4.12 . 22.10.2021 + 1. Параметр "Файл списка схем пользователя" может содержать не только путь до файла, но и путь до папки с hrc файлами. Аналог папки auto в схемах. + Версия 1.4.11 . 17.10.2021 1. Исправлена ошибка включения плагина, если до этого он был выключен. 2. В поставку включены полностью упакованные в архив схемы diff --git a/external/colorer b/external/colorer index 8db497a..ff164dd 160000 --- a/external/colorer +++ b/external/colorer @@ -1 +1 @@ -Subproject commit 8db497a9d0eeb0b99fad795f5e0559d813680e49 +Subproject commit ff164ddbaec3f972d86c5b5331ee7c17d37f5d17 diff --git a/misc/colorere.hlf b/misc/colorere.hlf index f95797f..889336a 100644 --- a/misc/colorere.hlf +++ b/misc/colorere.hlf @@ -42,7 +42,7 @@ $# FarColorer's settings Full file path sets default catalog file for FarColorer. If this field is empty FarColorer trying to find the file automatically in a subfolder of "base" parent directory plugin. #Users file of schemes# - Full file path sets the users file of schemes. + Full file path in this field specifies a file analogous to proto.hrc, or a directory with files containing with user schemes. If a directory is specified, only * .hrc files are processed. #Users file of color styles# Full file path sets the users file of color styles. diff --git a/misc/colorerr.hlf b/misc/colorerr.hlf index 69e20fd..0c78f00 100644 --- a/misc/colorerr.hlf +++ b/misc/colorerr.hlf @@ -46,7 +46,7 @@ $# Настройки плагина. Полный путь в этом поле задает базовый файл настроек catalog.xml. При обычной установке плагина FarColorer ищет этот файл в подпапке base папки плагина. #Файл списка схем пользователя# - Полный путь в этом поле задает файл со списком пользовательских схем. + Полный путь в этом поле задает файл аналог proto.hrc, или директорию с файлами, содержащими пользовательскиe схемы. В случае указания директории обрабатываются только *.hrc файлы. #Файл цветовых стилей пользователя# Полный путь в этом поле задает файл со списком цветовых стилей. diff --git a/src/FarEditorSet.cpp b/src/FarEditorSet.cpp index a3bdba5..7334154 100644 --- a/src/FarEditorSet.cpp +++ b/src/FarEditorSet.cpp @@ -418,7 +418,7 @@ INT_PTR WINAPI SettingDialogProc(HANDLE hDlg, intptr_t Msg, intptr_t Param1, voi bool FarEditorSet::configure() { - //TODO refactor this + // TODO refactor this try { PluginDialogBuilder Builder(Info, MainGuid, PluginConfig, mSetup, L"config", SettingDialogProc, this); Builder.AddCheckbox(mTurnOff, &Opt.rEnabled); @@ -446,7 +446,7 @@ bool FarEditorSet::configure() } else { cons = std::make_unique(); - cons->hrd_name= UnicodeString (Opt.HrdName); + cons->hrd_name = UnicodeString(Opt.HrdName); hrd_con_instances.push_back(cons.get()); console_style.push_back(Opt.HrdName); current_style = 0; @@ -467,7 +467,7 @@ bool FarEditorSet::configure() } else { rgb = std::make_unique(); - rgb->hrd_name= UnicodeString (Opt.HrdName); + rgb->hrd_name = UnicodeString(Opt.HrdName); hrd_rgb_instances.push_back(rgb.get()); rgb_style.push_back(Opt.HrdNameTm); current_rstyle = 0; @@ -1066,14 +1066,8 @@ void FarEditorSet::LoadUserHrd(const UnicodeString* filename, ParserFactory* pf) void FarEditorSet::LoadUserHrc(const UnicodeString* filename, ParserFactory* pf) { - if (filename && filename->length()) { - HRCParser* hr = pf->getHRCParser(); - uXmlInputSource dfis = XmlInputSource::newInstance(filename); - try { - hr->loadSource(dfis.get()); - } catch (Exception& e) { - throw Exception(e); - } + if (filename && !filename->isEmpty()) { + pf->loadHrcPath(*filename); } } diff --git a/src/version.h b/src/version.h index 1734b4d..dfae23d 100644 --- a/src/version.h +++ b/src/version.h @@ -11,7 +11,7 @@ #define PLUGIN_VER_MAJOR 1 #define PLUGIN_VER_MINOR 4 -#define PLUGIN_VER_PATCH 11 +#define PLUGIN_VER_PATCH 12 #define PLUGIN_DESC L"FarColorer - Syntax Highlighting for Far Manager 3" PLATFORM #define PLUGIN_NAME L"FarColorer" #define PLUGIN_FILENAME L"colorer.dll"