From da76d911f2b8979a1abb37731a341ee9ec255672 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Sun, 28 Apr 2019 12:51:37 +0200 Subject: [PATCH] + fix: RegEx "zero-length-finding" replace all bug + fix: settings versioning for Long-Line-Mark --- Versions/build.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/Edit.c | 4 ++-- src/Notepad3.c | 2 +- src/VersionEx.h | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Versions/build.txt b/Versions/build.txt index 5a9a9ee2f..b3892d901 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -1678 +1680 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 60aaec60b..aade4b7f0 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 develop diff --git a/src/Edit.c b/src/Edit.c index 5e6b608ec..f6edc3d8c 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -6341,13 +6341,13 @@ int EditReplaceAllInRange(HWND hwnd, LPCEDITFINDREPLACE lpefr, DocPos iStartPos, start = pPosPair->beg + totalReplLength; end = pPosPair->end + totalReplLength; } + DocPos const _move = (start != end) ? 0 : 1; // zero-find-length _ENTER_TARGET_TRANSACTION_; - SciCall_SetTargetRange(start, end); DocPos const replLen = Sci_ReplaceTarget(iReplaceMsg, -1, pszReplace); totalReplLength += replLen + pPosPair->beg - pPosPair->end; - searchStart = SciCall_GetTargetEnd(); + searchStart = SciCall_GetTargetEnd() + _move; _LEAVE_TARGET_TRANSACTION_; } diff --git a/src/Notepad3.c b/src/Notepad3.c index 788ef133e..cddf44d45 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -7153,7 +7153,7 @@ void LoadSettings() GET_BOOL_VALUE_FROM_INISECTION(BackspaceUnindents, false); GET_BOOL_VALUE_FROM_INISECTION(WarnInconsistentIndents, false); GET_BOOL_VALUE_FROM_INISECTION(AutoDetectIndentSettings, false); - GET_BOOL_VALUE_FROM_INISECTION(MarkLongLines, (s_iSettingsVersion < CFG_VER_0002)); + GET_BOOL_VALUE_FROM_INISECTION(MarkLongLines, (s_iSettingsVersion < CFG_VER_0002)); Defaults.MarkLongLines = false; // new default GET_INT_VALUE_FROM_INISECTION(LongLineMode, EDGE_LINE, EDGE_LINE, EDGE_BACKGROUND); GET_BOOL_VALUE_FROM_INISECTION(ShowSelectionMargin, true); GET_BOOL_VALUE_FROM_INISECTION(ShowLineNumbers, true); diff --git a/src/VersionEx.h b/src/VersionEx.h index 883f687f9..6982cf238 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -7,8 +7,8 @@ #define SAPPNAME "Notepad3" #define VERSION_MAJOR 5 #define VERSION_MINOR 19 -#define VERSION_REV 427 -#define VERSION_BUILD 1678 +#define VERSION_REV 428 +#define VERSION_BUILD 1680 #define SCINTILLA_VER 415 #define ONIGMO_REGEX_VER 6.2.0 #define VERSION_PATCH develop