diff --git a/Versions/build.txt b/Versions/build.txt index d00491fd7..0cfbf0888 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -1 +2 diff --git a/oniguruma/HISTORY b/oniguruma/HISTORY index 669daa416..dee6d0305 100644 --- a/oniguruma/HISTORY +++ b/oniguruma/HISTORY @@ -1,5 +1,9 @@ History +2020/04/26: Version 6.9.5 revised 1 + +2020/04/24: fix #192: Unexpected regex match + 2020/04/20: Version 6.9.5 2020/04/12: Release Candidate 2 for Version 6.9.5 diff --git a/oniguruma/README.md b/oniguruma/README.md index 665bad405..e9e7a738c 100644 --- a/oniguruma/README.md +++ b/oniguruma/README.md @@ -27,6 +27,12 @@ Supported character encodings: * doc/SYNTAX.md: contributed by seanofw +Version 6.9.5 revised 1 +----------------------- + +* Fixed Issue #192 + + Version 6.9.5 ------------- diff --git a/oniguruma/src/regcomp.c b/oniguruma/src/regcomp.c index ee0854ae7..86ad6b9f6 100644 --- a/oniguruma/src/regcomp.c +++ b/oniguruma/src/regcomp.c @@ -657,8 +657,11 @@ static void mmcl_alt_merge(MinMaxCharLen* to, MinMaxCharLen* alt) { if (to->min > alt->min) { - to->min = alt->min; - if (alt->min_is_sure != 0) + to->min = alt->min; + to->min_is_sure = alt->min_is_sure; + } + else if (to->min == alt->min) { + if (alt->min_is_sure != FALSE) to->min_is_sure = TRUE; } @@ -883,17 +886,17 @@ node_char_len1(Node* node, regex_t* reg, MinMaxCharLen* ci, ScanEnv* env, } break; + case NODE_GIMMICK: + mmcl_set(ci, 0); + break; + case NODE_ANCHOR: + zero: mmcl_set(ci, 0); /* can't optimize look-behind if anchor exists. */ ci->min_is_sure = FALSE; break; - case NODE_GIMMICK: - zero: - mmcl_set(ci, 0); - break; - case NODE_BACKREF: if (NODE_IS_CHECKER(node)) goto zero; @@ -7735,14 +7738,18 @@ print_indent_tree(FILE* f, Node* node, int indent) break; case NODE_CCLASS: +#define CCLASS_MBUF_MAX_OUTPUT_NUM 10 + fprintf(f, "", node); if (IS_NCCLASS_NOT(CCLASS_(node))) fputs(" not", f); if (CCLASS_(node)->mbuf) { BBuf* bbuf = CCLASS_(node)->mbuf; - for (i = 0; i < bbuf->used; i++) { + fprintf(f, " mbuf(%u) ", bbuf->used); + for (i = 0; i < bbuf->used && i < CCLASS_MBUF_MAX_OUTPUT_NUM; i++) { if (i > 0) fprintf(f, ","); fprintf(f, "%0x", bbuf->p[i]); } + if (i < bbuf->used) fprintf(f, "..."); } break; diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index e441ec63e..ff5be37b3 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 BETA diff --git a/src/Edit.c b/src/Edit.c index b1580cdd1..8b47b0bf5 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -5843,6 +5843,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara case WM_DESTROY: { _SetSearchFlags(hwnd, sg_pefrData); // sync + Settings.EFR_Data = *sg_pefrData; // remember options if (!s_bSwitchedFindReplace) { @@ -5904,7 +5905,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara DeleteObject(hBrushBlue); ResizeDlg_Destroy(hwnd, &Settings.FindReplaceDlgSizeX, NULL); } - return false; + return 0; case WM_SIZE: { diff --git a/src/Notepad3.c b/src/Notepad3.c index fcf9add31..76f68ea61 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -1793,18 +1793,21 @@ static void _SetWrapVisualFlags(HWND hwndEditCtrl) // static void _InitializeSciEditCtrl(HWND hwndEditCtrl) { - if (IsWindowsVistaOrGreater()) { - // Current platforms perform window buffering so it is almost always better for this option to be turned off. - // There are some older platforms and unusual modes where buffering may still be useful - so keep it ON - //~SciCall_SetBufferedDraw(true); // default is true - if (Settings.RenderingTechnology > 0) { - SciCall_SetTechnology(s_DirectWriteTechnology[Settings.RenderingTechnology]); - SciCall_SetBufferedDraw(false); - // experimental - SciCall_SetBidirectional(s_SciBidirectional[Settings.Bidirectional]); - } + // Current platforms perform window buffering so it is almost always better for this option to be turned off. + // There are some older platforms and unusual modes where buffering may still be useful - so keep it ON + //~SCI_SETBUFFEREDDRAW(true); // default is true + if (Settings.RenderingTechnology > 0) + { + SendMessage(hwndEditCtrl, SCI_SETTECHNOLOGY, (WPARAM)s_DirectWriteTechnology[Settings.RenderingTechnology], 0); + SendMessage(hwndEditCtrl, SCI_SETBUFFEREDDRAW, 0, 0); // false + SendMessage(hwndEditCtrl, SCI_SETBIDIRECTIONAL, (WPARAM)s_SciBidirectional[Settings.Bidirectional], 0); // experimental } - Encoding_Current(Settings.DefaultEncoding); + //~SendMessage(hwndEditCtrl, SCI_SETPHASESDRAW, SC_PHASES_TWO, 0); // (= default) + SendMessage(hwndEditCtrl, SCI_SETPHASESDRAW, SC_PHASES_MULTIPLE, 0); + //~SendMessage(hwndEditCtrl, SCI_SETLAYOUTCACHE, SC_CACHE_PAGE, 0); + SendMessage(hwndEditCtrl, SCI_SETLAYOUTCACHE, SC_CACHE_DOCUMENT, 0); + //~SendMessage(hwndEditCtrl, SCI_SETPOSITIONCACHE, 1024, 0); // default = 1024 + SendMessage(hwndEditCtrl, SCI_SETPOSITIONCACHE, 4096, 0); //int const evtMask = SC_MODEVENTMASKALL; // The possible notification types are the same as the modificationType bit flags used by SCN_MODIFIED: @@ -1821,9 +1824,6 @@ static void _InitializeSciEditCtrl(HWND hwndEditCtrl) SendMessage(hwndEditCtrl, SCI_SETMODEVENTMASK, (WPARAM)(evtMask1 | evtMask2), 0); SendMessage(hwndEditCtrl, SCI_SETCOMMANDEVENTS, false, 0); // speedup folding SendMessage(hwndEditCtrl, SCI_SETCODEPAGE, (WPARAM)SC_CP_UTF8, 0); // fixed internal UTF-8 (Sci:default) - SendMessage(hwndEditCtrl, SCI_SETLAYOUTCACHE, SC_CACHE_PAGE, 0); - //SendMessage(hwndEditCtrl, SCI_SETLAYOUTCACHE, SC_CACHE_DOCUMENT, 0); - //SendMessage(hwndEditCtrl, SCI_SETPHASESDRAW, SC_PHASES_MULTIPLE, 0); // default: SC_PHASES_TWO SendMessage(hwndEditCtrl, SCI_SETEOLMODE, Settings.DefaultEOLMode, 0); SendMessage(hwndEditCtrl, SCI_SETPASTECONVERTENDINGS, true, 0); @@ -1843,10 +1843,10 @@ static void _InitializeSciEditCtrl(HWND hwndEditCtrl) SendMessage(hwndEditCtrl, SCI_SETADDITIONALCARETSBLINK, true, 0); SendMessage(hwndEditCtrl, SCI_SETADDITIONALCARETSVISIBLE, true, 0); - SendMessage(hwndEditCtrl, SCI_SETIDLESTYLING, SC_IDLESTYLING_NONE, 0); // needed for focused view // Idle Styling (very large text) //~~~SendMessage(hwndEditCtrl, SCI_SETIDLESTYLING, SC_IDLESTYLING_AFTERVISIBLE, 0); //~~~SendMessage(hwndEditCtrl, SCI_SETIDLESTYLING, SC_IDLESTYLING_ALL, 0); + SendMessage(hwndEditCtrl, SCI_SETIDLESTYLING, SC_IDLESTYLING_NONE, 0); // needed for focused view // assign command keys SendMessage(hwndEditCtrl, SCI_ASSIGNCMDKEY, (SCK_NEXT + (SCMOD_CTRL << 16)), SCI_PARADOWN); @@ -2092,6 +2092,8 @@ LRESULT MsgCreate(HWND hwnd, WPARAM wParam,LPARAM lParam) } Style_SetDefaultLexer(Globals.hwndEdit); + Encoding_Current(Settings.DefaultEncoding); + ObserveNotifyChangeEvent(); return 0LL; diff --git a/src/Styles.c b/src/Styles.c index 9bc0691a5..cb91e8457 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -805,7 +805,6 @@ void Style_ToIniSection(bool bForceAll) // cleanup old (< v4) stuff IniSectionDelete(L"Default Text", NULL, true); IniSectionDelete(L"2nd Default Text", NULL, true); - } @@ -1495,10 +1494,10 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) Style_SetInvisible(hwnd, false); // set fixed invisible style - SciCall_StartStyling(0); - _OBSERVE_NOTIFY_CHANGE_; + SciCall_StartStyling(0); + // apply lexer styles if (Flags.bLargeFileLoaded) { diff --git a/src/VersionEx.h b/src/VersionEx.h index 32a99d355..c04c923b0 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -9,11 +9,11 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 20 #define VERSION_REV 428 -#define VERSION_BUILD 1 +#define VERSION_BUILD 2 #define SCINTILLA_VER 432 #define ONIGURUMA_REGEX_VER 6.9.5 #define UCHARDET_VER 2018.09.27 #define TINYEXPR_VER 2018.05.11 #define UTHASH_VER 2.1.0 #define VERSION_PATCH BETA -#define VERSION_COMMIT_ID dkt1-amr +#define VERSION_COMMIT_ID t7820-rk