+ fix: portable grepwin.ini file handling for grepWinNP3 integration

This commit is contained in:
Rainer Kottenhoff 2020-03-24 22:53:56 +01:00
parent 63ea67385c
commit 3bbbe99fdc
31 changed files with 83 additions and 54 deletions

View File

@ -45,3 +45,9 @@ You should have received a copy of the GNU General Public License along with thi
grepWin is developed by Stefan Küng (https://tools.stefankueng.com/grepWin.html).
Distributed grepWin binaries (currently v1.9.2) and corresponding source code (according to GPL v3.0)
can be retrived at folowing location https://github.com/stefankueng/grepWin/releases/tag/1.9.2.
Modified grepWinNP3 binaries (Notepad3 MOD, currently v1.9.2) and corresponding source code
(according to GPL v3.0) can be retrived at folowing location:
https://github.com/RaiKoHoff/grepWin/tree/grepWinNP3.
########################################################################################################

View File

@ -15,7 +15,7 @@ SettingsVersion=4
;DefaultWindowPosition=
;DenyVirtualSpaceAccess=0
;filebrowser.exe=minipath.exe
;grepWin.exe=grepWin\grepWin_portable.exe
;grepWin.exe=grepWinNP3_portable.exe
;FileCheckInverval=2000
;FileDlgFilters=
;FileLoadWarningMB=64

View File

@ -623,7 +623,11 @@ copy of the Program in return for a fee.
########################################################################################################
grepWin is developed by Stefan Küng (https://tools.stefankueng.com/grepWin.html).
Distributed grepWin binaries (currently v1.9.2) and corresponding source code (according to GPL v3.0)
Original grepWin binaries (currently v1.9.2) and corresponding source code (according to GPL v3.0)
can be retrived at folowing location https://github.com/stefankueng/grepWin/releases/tag/1.9.2.
Modified grepWinNP3 binaries (Notepad3 MOD, currently v1.9.2) and corresponding source code
(according to GPL v3.0) can be retrived at folowing location:
https://github.com/RaiKoHoff/grepWin/tree/grepWinNP3.
########################################################################################################

View File

@ -1 +1 @@
1
2

View File

@ -161,12 +161,12 @@ copy /B "%NP3_X64_DIR%\minipath.exe" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x64\" /Y
::copy /B "%NP3_DISTRIB_DIR%\Update\wyUpdate\64\wyUpdate.exe" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x64\" /Y /V
copy "%NP3_GREPWIN_DIR%\GPL_v3.0_LICENSE.txt" "%NP3_PORTAPP_DIR%\Other\Help\grepWin_GPL_v3.0_LICENSE.txt" /Y /V
mkdir "%NP3_PORTAPP_DIR%\App\Notepad3\x86\grepWin"
copy /B "%NP3_GREPWIN_DIR%\grepWinNP3_portable.exe" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x86\grepWin\grepWinNP3_portable.exe" /Y /V
copy /B "%NP3_GREPWIN_DIR%\*.lang" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x86\grepWin\" /Y /V
mkdir "%NP3_PORTAPP_DIR%\App\Notepad3\x64\grepWin"
copy /B "%NP3_GREPWIN_DIR%\grepWinNP3_x64_portable.exe" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x64\grepWin\grepWinNP3_portable.exe" /Y /V
copy /B "%NP3_GREPWIN_DIR%\*.lang" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x64\grepWin\" /Y /V
mkdir "%NP3_PORTAPP_DIR%\App\Notepad3\x86\lng\gwLng"
copy /B "%NP3_GREPWIN_DIR%\grepWinNP3_portable.exe" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x86\grepWinNP3_portable.exe" /Y /V
copy /B "%NP3_GREPWIN_DIR%\*.lang" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x86\lng\gwLng\" /Y /V
mkdir "%NP3_PORTAPP_DIR%\App\Notepad3\x64\lng\gwLng"
copy /B "%NP3_GREPWIN_DIR%\grepWinNP3_x64_portable.exe" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x64\grepWinNP3_portable.exe" /Y /V
copy /B "%NP3_GREPWIN_DIR%\*.lang" /B "%NP3_PORTAPP_DIR%\App\Notepad3\x64\lng\gwLng\" /Y /V
:: --------------------------------------------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.20.324.1"
version="5.20.324.2"
type="win32"
/>
<description>Notepad3 NF</description>

View File

@ -3481,17 +3481,12 @@ static grepWin_t grepWinIniSettings[13] =
void DialogGrepWin(HWND hwnd, LPCWSTR searchPattern)
{
WCHAR tchTemp[MAX_PATH] = { L'\0' };
WCHAR tchModulePath[MAX_PATH] = { L'\0' };
WCHAR tchNotepad3Path[MAX_PATH] = { L'\0' };
WCHAR tchExeFile[MAX_PATH] = { L'\0' };
WCHAR tchOptions[MAX_PATH] = { L'\0' };
WCHAR tchParams[MAX_PATH * 2] = { L'\0' };
WCHAR tchGrepWinDir[MAX_PATH] = { L'\0' };
WCHAR tchIniFilePath[MAX_PATH] = { L'\0' };
const WCHAR* const tchParamFmt = L"/portable /content %s /searchpath:\"%s\" /searchfor:\"%s\"";
GetModuleFileName(NULL, tchModulePath, COUNTOF(tchModulePath));
PathCanonicalizeEx(tchModulePath, COUNTOF(tchModulePath));
GetModuleFileName(NULL, tchNotepad3Path, COUNTOF(tchNotepad3Path));
PathCanonicalizeEx(tchNotepad3Path, COUNTOF(tchNotepad3Path));
// grepWin executable
if (StrIsNotEmpty(Settings2.GrepWinPath)) {
@ -3502,25 +3497,36 @@ void DialogGrepWin(HWND hwnd, LPCWSTR searchPattern)
StringCchCopy(tchExeFile, COUNTOF(tchExeFile), Constants.FileSearchGrepWin);
}
if (PathIsRelative(tchExeFile)) {
StringCchCopy(tchTemp, COUNTOF(tchTemp), tchModulePath);
StringCchCopy(tchTemp, COUNTOF(tchTemp), tchNotepad3Path);
PathCchRemoveFileSpec(tchTemp, COUNTOF(tchTemp));
PathAppend(tchTemp, tchExeFile);
if (PathFileExists(tchTemp)) {
StringCchCopy(tchExeFile, COUNTOF(tchExeFile), tchTemp);
}
}
// working (grepwin.ini) directory
if (PathFileExists(tchExeFile)) {
WCHAR tchGrepWinDir[MAX_PATH] = { L'\0' };
WCHAR tchIniFilePath[MAX_PATH] = { L'\0' };
if (PathFileExists(tchExeFile))
{
StringCchCopy(tchGrepWinDir, COUNTOF(tchGrepWinDir), tchExeFile);
PathCchRemoveFileSpec(tchGrepWinDir, COUNTOF(tchGrepWinDir));
// relative Notepad3 path (for grepWin's EditorCmd)
if (PathRelativePathToW(tchTemp, tchGrepWinDir, FILE_ATTRIBUTE_DIRECTORY, tchModulePath, FILE_ATTRIBUTE_NORMAL)) {
StringCchCopy(tchModulePath, COUNTOF(tchModulePath), tchTemp);
if (PathRelativePathTo(tchTemp, tchGrepWinDir, FILE_ATTRIBUTE_DIRECTORY, tchNotepad3Path, FILE_ATTRIBUTE_NORMAL)) {
StringCchCopy(tchNotepad3Path, COUNTOF(tchNotepad3Path), tchTemp);
}
// grepWin INI-File
StringCchCopy(tchIniFilePath, COUNTOF(tchIniFilePath), tchGrepWinDir);
PathAppend(tchIniFilePath, L"grepwin.ini");
const WCHAR* const gwIniFileName = L"grepwin.ini";
StringCchCopy(tchIniFilePath, COUNTOF(tchIniFilePath), StrIsNotEmpty(Globals.IniFile) ? Globals.IniFile : Globals.IniFileDefault);
PathRemoveFileSpec(tchIniFilePath);
PathAppend(tchIniFilePath, gwIniFileName);
if (PathIsRelative(tchIniFilePath)) {
StringCchCopy(tchIniFilePath, COUNTOF(tchIniFilePath), tchGrepWinDir);
PathAppend(tchIniFilePath, gwIniFileName);
}
if (!PathFileExists(tchIniFilePath)) {
HANDLE hFile = CreateFile(tchIniFilePath,
GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
@ -3531,6 +3537,7 @@ void DialogGrepWin(HWND hwnd, LPCWSTR searchPattern)
}
}
// get grepWin language
int lngIdx = -1;
for (int i = 0; i < grepWinLang_CountOf(); ++i) {
@ -3559,8 +3566,8 @@ void DialogGrepWin(HWND hwnd, LPCWSTR searchPattern)
}
}
//~StringCchPrintf(tchTemp, COUNTOF(tchTemp), L"%s /g %%line%% /m %s - %%path%%", tchModulePath, searchPattern);
StringCchPrintf(tchTemp, COUNTOF(tchTemp), L"%s /g %%line%% - %%path%%", tchModulePath);
//~StringCchPrintf(tchTemp, COUNTOF(tchTemp), L"%s /g %%line%% /m %s - %%path%%", tchNotepad3Path, searchPattern);
StringCchPrintf(tchTemp, COUNTOF(tchTemp), L"%s /g %%line%% - %%path%%", tchNotepad3Path);
IniSectionSetString(L"global", L"editorcmd", tchTemp);
// [settings]
@ -3575,13 +3582,23 @@ void DialogGrepWin(HWND hwnd, LPCWSTR searchPattern)
}
// search directory
StringCchCopy(tchTemp, COUNTOF(tchTemp), Globals.CurrentFile);
if (StrIsNotEmpty(tchTemp)) {
PathCchRemoveFileSpec(tchTemp, COUNTOF(tchTemp));
WCHAR tchSearchDir[MAX_PATH] = { L'\0' };
if (StrIsNotEmpty(Globals.CurrentFile)) {
StringCchCopy(tchSearchDir, COUNTOF(tchSearchDir), Globals.CurrentFile);
PathCchRemoveFileSpec(tchSearchDir, COUNTOF(tchSearchDir));
}
else {
StringCchCopy(tchSearchDir, COUNTOF(tchSearchDir), Globals.WorkingDirectory);
}
// grepWin arguments
StringCchPrintf(tchParams, COUNTOF(tchParams), tchParamFmt, tchOptions, tchTemp, searchPattern);
const WCHAR* const tchParamFmt = L"/portable /content %s /inipath:\"%s\" /searchpath:\"%s\" /searchfor:\"%s\"";
WCHAR tchParams[MAX_PATH * 2] = { L'\0' };
// relative grepwin.ini path (for shorter cmdline)
if (PathRelativePathTo(tchTemp, tchGrepWinDir, FILE_ATTRIBUTE_DIRECTORY, tchIniFilePath, FILE_ATTRIBUTE_NORMAL)) {
StringCchCopy(tchIniFilePath, COUNTOF(tchIniFilePath), tchTemp);
}
StringCchPrintf(tchParams, COUNTOF(tchParams), tchParamFmt, tchOptions, tchIniFilePath, tchSearchDir, searchPattern);
//if (StrIsNotEmpty(searchPattern)) {
// SetClipboardTextW(hwnd, searchPattern, StringCchLen(searchPattern, 0));
//}

View File

@ -63,25 +63,25 @@ int MuiLanguages_CountOf() { return COUNTOF(MUI_LanguageDLLs); };
grepWinLng_t grepWinLangResName[] =
{
{ MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), L"[en-US] English (United States).lang"},
{ MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), L"[af-ZA] Afrikaans (Suid-Afrika).lang"},
{ MAKELANGID(LANG_BELARUSIAN, SUBLANG_BELARUSIAN_BELARUS), L"[be-BY] Беларуская (Беларусь).lang"},
{ MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), L"[de-DE] Deutsch (Deutschland).lang"},
{ MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_UK), L"[en-GB] English (United Kingdom).lang"},
{ MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), L"[es-ES] Español (España).lang"},
{ MAKELANGID(LANG_FRENCH, SUBLANG_FRENCH), L"[fr-FR] Français (France).lang"},
{ MAKELANGID(LANG_HUNGARIAN, SUBLANG_HUNGARIAN_HUNGARY), L"[hu-HU] Magyar (Magyarország).lang"},
{ MAKELANGID(LANG_ITALIAN, SUBLANG_ITALIAN), L"[it-IT] Italiano (Italia).lang"},
{ MAKELANGID(LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN), L"[ja-JP] 日本語 (日本).lang"},
{ MAKELANGID(LANG_KOREAN, SUBLANG_KOREAN), L"[ko-KR] 한국어 (대한민국).lang"},
{ MAKELANGID(LANG_DUTCH, SUBLANG_DUTCH), L"[nl-NL] Nederlands (Nederland).lang"},
{ MAKELANGID(LANG_POLISH, SUBLANG_POLISH_POLAND), L"[pl-PL] Polski (Polska)Polski.lang"},
{ MAKELANGID(LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN), L"[pt-BR] Português (Brasil).lang"},
{ MAKELANGID(LANG_RUSSIAN, SUBLANG_RUSSIAN_RUSSIA), L"[ru-RU] Русский (Pоссия).lang"},
{ MAKELANGID(LANG_SLOVAK, SUBLANG_SLOVAK_SLOVAKIA), L"[sk-SK] Slovenčina (Slovensko).lang"},
{ MAKELANGID(LANG_SWEDISH, SUBLANG_SWEDISH), L"[sv-SE] Svenska (Sverige).lang"},
{ MAKELANGID(LANG_TURKISH, SUBLANG_TURKISH_TURKEY), L"[tr-TR] Türkçe (Türkiye).lang"},
{ MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), L"[zh-CN] 简体中文 (中国).lang"}
{ MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), L".\\lng\\gwLng\\English (United States) [en-US].lang"},
{ MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), L".\\lng\\gwLng\\Afrikaans (Suid-Afrika) [af-ZA].lang"},
{ MAKELANGID(LANG_BELARUSIAN, SUBLANG_BELARUSIAN_BELARUS), L".\\lng\\gwLng\\Беларуская (Беларусь) [be-BY].lang"},
{ MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), L".\\lng\\gwLng\\Deutsch (Deutschland) [de-DE].lang"},
{ MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_UK), L".\\lng\\gwLng\\English (United Kingdom) [en-GB].lang"},
{ MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), L".\\lng\\gwLng\\Español (España) [es-ES].lang"},
{ MAKELANGID(LANG_FRENCH, SUBLANG_FRENCH), L".\\lng\\gwLng\\Français (France) [fr-FR].lang"},
{ MAKELANGID(LANG_HUNGARIAN, SUBLANG_HUNGARIAN_HUNGARY), L".\\lng\\gwLng\\Magyar (Magyarország) [hu-HU].lang"},
{ MAKELANGID(LANG_ITALIAN, SUBLANG_ITALIAN), L".\\lng\\gwLng\\Italiano (Italia) [it-IT].lang"},
{ MAKELANGID(LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN), L".\\lng\\gwLng\\日本語 (日本)[ja-JP].lang"},
{ MAKELANGID(LANG_KOREAN, SUBLANG_KOREAN), L".\\lng\\gwLng\\한국어 (대한민국) [ko-KR].lang"},
{ MAKELANGID(LANG_DUTCH, SUBLANG_DUTCH), L".\\lng\\gwLng\\Nederlands (Nederland) [nl-NL].lang"},
{ MAKELANGID(LANG_POLISH, SUBLANG_POLISH_POLAND), L".\\lng\\gwLng\\Polski (Polska)Polski [pl-PL].lang"},
{ MAKELANGID(LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN), L".\\lng\\gwLng\\Português (Brasil) [pt-BR].lang"},
{ MAKELANGID(LANG_RUSSIAN, SUBLANG_RUSSIAN_RUSSIA), L".\\lng\\gwLng\\Русский (Pоссия) [ru-RU].lang"},
{ MAKELANGID(LANG_SLOVAK, SUBLANG_SLOVAK_SLOVAKIA), L".\\lng\\gwLng\\Slovenčina (Slovensko) [sk-SK].lang"},
{ MAKELANGID(LANG_SWEDISH, SUBLANG_SWEDISH), L".\\lng\\gwLng\\Svenska (Sverige) [sv-SE].lang"},
{ MAKELANGID(LANG_TURKISH, SUBLANG_TURKISH_TURKEY), L".\\lng\\gwLng\\Türkçe (Türkiye) [tr-TR].lang"},
{ MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), L".\\lng\\gwLng\\简体中文 (中国)[zh-CN].lang"}
};
int grepWinLang_CountOf() { return COUNTOF(grepWinLangResName); };

View File

@ -55,7 +55,7 @@
CONSTANTS_T const Constants = {
2 // StdDefaultLexerID
, L"minipath.exe" // FileBrowserMiniPath
, L"grepWin\\grepWinNP3_portable.exe" // FileSearchGrepWin
, L"grepWinNP3_portable.exe" // FileSearchGrepWin
, L"ThemeFileName" // StylingThemeName
, L"Settings" // Inifile Section "Settings"
, L"Settings2" // Inifile Section "Settings2"

View File

@ -74,7 +74,9 @@
#if defined(_MSC_VER)
#if (_MSC_VER == 1925)
#if(_MSC_FULL_VER >= 192528610)
#if(_MSC_FULL_VER >= 192528611)
#define VER_CPL MS Visual C++ 2019 v16.5.1
#elif(_MSC_FULL_VER >= 192528610)
#define VER_CPL MS Visual C++ 2019 v16.5.0
#endif
#elif (_MSC_VER == 1924)

View File

@ -9,11 +9,11 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 20
#define VERSION_REV 324
#define VERSION_BUILD 1
#define VERSION_BUILD 2
#define SCINTILLA_VER 432
#define ONIGURUMA_REGEX_VER 6.9.4
#define UCHARDET_VER 2018.09.27
#define TINYEXPR_VER 2018.05.11
#define UTHASH_VER 2.1.0
#define VERSION_PATCH NF
#define VERSION_COMMIT_ID t7820-rk
#define VERSION_COMMIT_ID nebukadn