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 5a4ef4863..1f4a8eab1 100644 Binary files a/Versions/VersionEx.h.tpl and b/Versions/VersionEx.h.tpl differ diff --git a/Versions/build.txt b/Versions/build.txt index 1f276db26..021807516 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -729 +747 diff --git a/np3portableapp/Notepad3Portable/App/DefaultData/settings/Notepad3.ini b/np3portableapp/Notepad3Portable/App/DefaultData/settings/Notepad3.ini index 051fb93b5..66b8a508b 100644 Binary files a/np3portableapp/Notepad3Portable/App/DefaultData/settings/Notepad3.ini and b/np3portableapp/Notepad3Portable/App/DefaultData/settings/Notepad3.ini differ diff --git a/np3portableapp/build_np3portableapp.cmd b/np3portableapp/build_np3portableapp.cmd index 9b67d6253..8946090b2 100644 --- a/np3portableapp/build_np3portableapp.cmd +++ b/np3portableapp/build_np3portableapp.cmd @@ -34,7 +34,7 @@ set PORTAPP_ROOT_DIR=D:\PortableApps set PORTAPP_LAUNCHER_CREATOR=%PORTAPP_ROOT_DIR%\PortableApps.comLauncher\PortableApps.comLauncherGenerator.exe set PORTAPP_INSTALLER_CREATOR=%PORTAPP_ROOT_DIR%\PortableApps.comInstaller\PortableApps.comInstaller.exe -set NP3_DISTRIB_DIR=%SCRIPT_DIR%..\distrib +set NP3_DISTRIB_DIR=%SCRIPT_DIR%..\Build set NP3_WIN32_DIR=%SCRIPT_DIR%..\Bin\Release_x86_v141 set NP3_X64_DIR=%SCRIPT_DIR%..\Bin\Release_x64_v141 @@ -53,7 +53,7 @@ set BUILD=0 call :GETBUILD :: VERSION fallback from build date -set VERSION=2.%YY%.%MM%%DD%.%BUILD% +set VERSION=3.%YY%.%MM%%DD%.%BUILD% set FILEVER= call :GETFILEVER "%NP3_WIN32_DIR%\Notepad3.exe" 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..617d6790b 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 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/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; } 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() diff --git a/src/Notepad3.rc b/src/Notepad3.rc index d1721127a..49008d4b3 100644 Binary files a/src/Notepad3.rc and b/src/Notepad3.rc differ 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..c15f92b31 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 747 #define SCINTILLA_VER 402 +#define ONIGMO_REGEX_VER 6.1.3