+ fix: lost Find/Replace dialog settings

+ fix: lazy syntax styling (copy into multi-line string, etc.)
This commit is contained in:
RaiKoHoff 2020-04-28 13:13:34 +02:00
parent 722183f169
commit 720f2265fb
6 changed files with 25 additions and 23 deletions

View File

@ -1 +1 @@
1
2

View File

@ -3,7 +3,7 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.20.428.1"
version="5.20.428.2"
type="win32"
/>
<description>Notepad3 BETA</description>

View File

@ -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: {

View File

@ -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;

View File

@ -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)
{

View File

@ -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