From e45494ed700ea1aec44b733c101fcfc34a710079 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Fri, 15 Dec 2017 08:53:12 +0100 Subject: [PATCH 1/5] + fix: version and build information templates --- Version.ps1 | 3 +++ Versions/VersionEx.h.tpl | Bin 310 -> 1016 bytes Versions/build.txt | 2 +- onigmo/version.txt | 1 + res/Notepad3.exe.manifest.conf | 2 +- src/Notepad3.vcxproj | 15 +++++++++++++++ src/Notepad3.vcxproj.filters | 17 +++++++++++++++++ src/Version.h | 2 +- src/VersionEx.h | 10 ++++++++-- 9 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 onigmo/version.txt diff --git a/Version.ps1 b/Version.ps1 index f0ef4075d..061ac12f0 100644 --- a/Version.ps1 +++ b/Version.ps1 @@ -43,6 +43,8 @@ try if (!$Build) { $Build = 0 } $SciVer = [int](Get-Content "scintilla\version.txt") if (!$SciVer) { $SciVer = 0 } + $OnigmoVer = [string](Get-Content "onigmo\version.txt") + if (!$OnigmoVer) { $OnigmoVer = "0.0.0" } $CompleteVer = "$Major.$Minor.$Revis.$Build" DebugOutput("Version number: '$CompleteVer'") @@ -53,6 +55,7 @@ try (Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$MAINT\$', "$Revis" } | Set-Content "src\VersionEx.h" (Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$BUILD\$', "$Build" } | Set-Content "src\VersionEx.h" (Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$SCIVER\$', "$SciVer" } | Set-Content "src\VersionEx.h" + (Get-Content "src\VersionEx.h") | ForEach-Object { $_ -replace '\$ONIGMOVER\$', "$OnigmoVer" } | Set-Content "src\VersionEx.h" Copy-Item -LiteralPath "Versions\Notepad3.exe.manifest.tpl" -Destination "res\Notepad3.exe.manifest.conf" -Force (Get-Content "res\Notepad3.exe.manifest.conf") | ForEach-Object { $_ -replace '\$VERSION\$', $CompleteVer } | Set-Content "res\Notepad3.exe.manifest.conf" if ($AppVeyorEnv) { diff --git a/Versions/VersionEx.h.tpl b/Versions/VersionEx.h.tpl index 5a4ef48638336e87c0f74d150223b4d65bd62077..1f4a8eab1633720f70fa7e1f82b3aa627ed7870d 100644 GIT binary patch literal 1016 zcmcgp%L>9k44kvzKNRd$`VGD)m1?2Y;;j_l;0vt>e_oyJs#~Q{Ps}uExY_P?JGpu;;u%xHsHT?taj2s2;1z*~iyXWj8y@W$+ZP@K@{>yIv*R}F3YPnQ;i@pw03=kthfCyt`7@>n9{g`iV zDRR}n)uRJ;G3a;nA3EkN>4#Ua6V4z%R>#}LlpBQTE3}EK(FuC2mhOTHxpDT=L3Y-! aT9<0PC>6k`IuVgFwNIOUbt%`Bdp!Y>M{^7S delta 16 YcmeytzKx0L|G&w4%nF-lFo`e%06cyL{Qv*} diff --git a/Versions/build.txt b/Versions/build.txt index 1f276db26..064c0200b 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -729 +744 diff --git a/onigmo/version.txt b/onigmo/version.txt new file mode 100644 index 000000000..88d06f108 --- /dev/null +++ b/onigmo/version.txt @@ -0,0 +1 @@ +6.1.3 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 25d8811ac..cffb6ae2d 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 diff --git a/src/Notepad3.vcxproj b/src/Notepad3.vcxproj index 41db756d5..1735a0f83 100644 --- a/src/Notepad3.vcxproj +++ b/src/Notepad3.vcxproj @@ -324,6 +324,7 @@ + @@ -335,6 +336,8 @@ + + @@ -354,6 +357,18 @@ + + + + + + + + + + + + diff --git a/src/Notepad3.vcxproj.filters b/src/Notepad3.vcxproj.filters index 17ea04918..330b76499 100644 --- a/src/Notepad3.vcxproj.filters +++ b/src/Notepad3.vcxproj.filters @@ -16,6 +16,9 @@ {aad339da-f291-4358-9ab1-a0fdee012ac6} + + {e817f780-f742-48b4-bc9c-2ab762ced6bc} + @@ -92,6 +95,9 @@ Crypto + + Resource Files + @@ -124,6 +130,12 @@ Resource Files + + templates + + + templates + @@ -143,4 +155,9 @@ Resource Files + + + templates + + \ No newline at end of file diff --git a/src/Version.h b/src/Version.h index 747b89f60..948be4962 100644 --- a/src/Version.h +++ b/src/Version.h @@ -41,7 +41,7 @@ #define VERSION_COMPANYNAME L"© Rizonesoft" #define VERSION_MODPAGEDISPLAY L"https://xhmikosr.github.io/notepad2-mod/" #define VERSION_WEBPAGE2DISPLAY L"http://www.flos-freeware.ch" -#define VERSION_SCIVERSION L"Scintilla Library (RegEx:Onigmo v.6.1.3) Version: " STRINGIFY(SCINTILLA_VER) +#define VERSION_SCIVERSION L"Scintilla Library Ver: " STRINGIFY(SCINTILLA_VER) L" (RegEx:Onigmo v." STRINGIFY(ONIGMO_REGEX_VER) L")" #if defined(_WIN64) // #define VERSION_FILEVERSION_LONG L"Notepad3 (64-bit) " STRINGIFY(VERSION_MAJOR) L" Build " \ diff --git a/src/VersionEx.h b/src/VersionEx.h index ec3d09f3b..6a6bccdc9 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -1,5 +1,11 @@ +// ////////////////////////////////////////////////////////// +// // +// this file is generated - use template to apply changes // +// // +// ////////////////////////////////////////////////////////// #define VERSION_MAJOR 3 #define VERSION_MINOR 17 -#define VERSION_REV 1210 -#define VERSION_BUILD 729 +#define VERSION_REV 1215 +#define VERSION_BUILD 744 #define SCINTILLA_VER 402 +#define ONIGMO_REGEX_VER 6.1.3 From 9c56e6a17f44fd93d2958e76ac8690497bc19dc9 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Fri, 15 Dec 2017 09:52:55 +0100 Subject: [PATCH 2/5] + fix: issue regarding TransformBackslash handler (regex vs. std & find vs. replace) --- src/Helpers.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Helpers.c b/src/Helpers.c index ee6e3fc23..c97b01b6a 100644 --- a/src/Helpers.c +++ b/src/Helpers.c @@ -2453,17 +2453,19 @@ int CheckRegExReplTarget(char* pszInput) void TransformBackslashes(char* pszInput, BOOL bRegEx, UINT cpEdit, int* iReplaceMsg) { - int replTarget = SCI_REPLACETARGET; - - if (bRegEx) { + if (bRegEx && iReplaceMsg) { UnSlashLowOctal(pszInput); - replTarget = CheckRegExReplTarget(pszInput); + *iReplaceMsg = CheckRegExReplTarget(pszInput); } - if (SCI_REPLACETARGET == replTarget) { + else if (iReplaceMsg) { + *iReplaceMsg = SCI_REPLACETARGET; // uses SCI std replacement + } + + // regex handles backslashes itself + // except: replacement is not delegated to regex engine + if (!bRegEx || (iReplaceMsg && (SCI_REPLACETARGET == *iReplaceMsg))) { UnSlash(pszInput, cpEdit); } - if (iReplaceMsg) - *iReplaceMsg = replTarget; } From 40385765b53752479357b6f8ee3603eb82f0bba2 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Fri, 15 Dec 2017 10:04:06 +0100 Subject: [PATCH 3/5] + fix: replace dialog: resize regex text box to not overlay other control --- Versions/build.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/Notepad3.rc | Bin 184784 -> 184782 bytes src/VersionEx.h | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Versions/build.txt b/Versions/build.txt index 064c0200b..021807516 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -744 +747 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index cffb6ae2d..617d6790b 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 diff --git a/src/Notepad3.rc b/src/Notepad3.rc index d1721127a76bf9ffd25358b1bf9f6d6c93c39dc2..49008d4b374c12f9d187a504aacfd59fc03b7d7c 100644 GIT binary patch delta 155 zcmcbxnETvf?hR|!O%^z4HTmCqgUNZ;BAd0=zblxYBgn|HT|t4-gPqxu!F+mQ1f%)% zePWEuwtHzX3NTI2kz_nDT}qqLV0wTQqr&t89Y&?;7bKWirccmjv|==yep;Kc6-Wi@ zFjfPpvpS5aAcZWYx0Zj29y7-H<+AfEwWi_{ksB2qwSIkjQ;Gbh71M_hSM7_ zGn!A|C&svJyN3p&028C>^!1gD_R~KEFtJSEAjxPo{lFGRh3Nw6j2hGBv>CO4@_|x} z^3xss7?q|^&<85&(`K|{HD%CYFr9wTno$}e!==OM0#xd+!&uD@lCxwmn*LFeF`g5| u0aW6AVue;I|g|9i!F;TZrl2tla; diff --git a/src/VersionEx.h b/src/VersionEx.h index 6a6bccdc9..c15f92b31 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -6,6 +6,6 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 17 #define VERSION_REV 1215 -#define VERSION_BUILD 744 +#define VERSION_BUILD 747 #define SCINTILLA_VER 402 #define ONIGMO_REGEX_VER 6.1.3 From 322c8bdec9c3e8a087be9c2a23ab0a21a7df60d8 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Fri, 15 Dec 2017 10:11:05 +0100 Subject: [PATCH 4/5] + fix: PortableApp build script: initial .ini files dir changed from distrib to Build --- .../App/DefaultData/settings/Notepad3.ini | Bin 2144 -> 2424 bytes np3portableapp/build_np3portableapp.cmd | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/np3portableapp/Notepad3Portable/App/DefaultData/settings/Notepad3.ini b/np3portableapp/Notepad3Portable/App/DefaultData/settings/Notepad3.ini index 051fb93b5e01ae021fcd5d42a8f9ada3464605fe..66b8a508b363ddd74c1acdde39a3fa38f2860181 100644 GIT binary patch delta 502 zcmaDL@Iz?B3?@eF$t@Li@|#GekOUK_+2JNAo-U`9Y`uOD?64jR4|k< zfK@QKFr+f%F;p^yF=R3n0Yyt05*czBf*A^cbTUxR5lDjQVj#2ynhY`5lUY$V7pNl- zh(Rh#7%~|2fT}8h7@{JV8Qm>YnU#U|Z)a9zH-xIW&uplV;$8+{p#3>O(=r*{fH((i ze-T4ElFf!J;_NV2c(X{u*_kYgaCR??B%HmHMILV7X%=Zta|TnW?JrqC;la-e3L#xq zb-0djR(W<~sG3Svbw-29^I4|@)tItr*F$Y)2m!h-7wEcRpj#7xtOB45V}MWv7@nZe zNM*2Mh-Qd`ip4T$Ls<$8H4F+UsuUPh86p|s{%se N&6v?(^IEpei~#U;Rtf+B delta 314 zcmew%^gv+445rDmm{gc~8Mr2&W|E)$hDl*EAG6wIGiD{Q*i2?cFnyg_6-;xoC{Na7 zfvAsUF^mN2WAJ4tWyoPDVaQ}~1L7QpR0c+o7$dCdQ^#JNj0kiTTvXg(ZKx|fIl?2=D$SSW0GS8o(0H`M!sJ?`ulEDY4w+x7L zpt`zQ)n$W#{8FGTsSM#jRe3;D^BKy4@&+LHOuo#j4mOXGO&(0Ev#C!GV4F7i1)G*M i$ovqXo?M{bV4(SlKvn_N Date: Fri, 15 Dec 2017 10:37:41 +0100 Subject: [PATCH 5/5] + fix: enable more hyperlink styling trigger points, since "replace target" race-conditions have been fixed and fast regex engine (Onigmo) is integrated + fix: issue regarding applying lexer style while hyperlink feature is active --- src/Edit.c | 6 +++++- src/Notepad3.c | 9 +++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Edit.c b/src/Edit.c index 1659a5580..ed22239c7 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -5696,6 +5696,10 @@ void EditUpdateUrlHotspots(HWND hwnd, int startPos, int endPos, BOOL bActiveHots int tmp = startPos; startPos = endPos; endPos = tmp; // swap } + // 1st apply current lexer style + SciCall_StartStyling(startPos); + SendMessage(hwnd, SCI_COLOURISE, 0, (LPARAM)-1); + const char* pszUrlRegEx = "\\b(?:(?:https?|ftp|file)://|www\\.|ftp\\.)" "(?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*" "(?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[A-Z0-9+&@#/%=~_|$])"; @@ -5734,7 +5738,7 @@ void EditUpdateUrlHotspots(HWND hwnd, int startPos, int endPos, BOOL bActiveHots if (bActiveHotspot) { SciCall_StartStyling(endPos); - UpdateEditWndUI(); + UpdateEditWndUI(); // does not apply lexer style } else { SciCall_StartStyling(startPos); diff --git a/src/Notepad3.c b/src/Notepad3.c index 4a40c8a39..46efaa1c7 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -5670,11 +5670,11 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam) } } else if (scn->modificationType & SC_MOD_CHANGESTYLE) { - //EditUpdateUrlHotspots(hwndEdit, (int)scn->position, (int)(scn->position + scn->length), bHyperlinkHotspot); + EditUpdateUrlHotspots(hwndEdit, (int)scn->position, (int)(scn->position + scn->length), bHyperlinkHotspot); } if (scn->linesAdded != 0) { + EditUpdateUrlHotspots(hwndEdit, 0, SciCall_GetTextLength(), bHyperlinkHotspot); UpdateLineNumberWidth(); - //~EditUpdateUrlHotspots(hwndEdit, 0, SciCall_GetTextLength(), bHyperlinkHotspot); } bModified = TRUE; break; @@ -7000,7 +7000,6 @@ int CreateIniFileEx(LPCWSTR lpszIniFile) { } - //============================================================================= // // UpdateEditWndUI() @@ -7014,10 +7013,12 @@ void UpdateEditWndUI() scn.updated = SC_UPDATE_CONTENT; //SendMessage(hwndMain, WM_NOTIFY, IDC_EDIT, (LPARAM)&scn); PostMessage(hwndMain, WM_NOTIFY, IDC_EDIT, (LPARAM)&scn); + // -------------------------------------------------------------- + //~ don't SendMessage(hwnd, SCI_COLOURISE, 0, (LPARAM)-1); here ! + // -------------------------------------------------------------- } - //============================================================================= // // UpdateToolbar()