diff --git a/scintilla/doc/ScintillaDoc.html b/scintilla/doc/ScintillaDoc.html index ee78740e0..709b0e7ad 100644 --- a/scintilla/doc/ScintillaDoc.html +++ b/scintilla/doc/ScintillaDoc.html @@ -7264,6 +7264,8 @@ struct SCNotification {
The following SCI_* messages are associated with these notifications:
SCI_SETMODEVENTMASK(int eventMask)
SCI_GETMODEVENTMASK → int
+ SCI_SETCOMMANDEVENTS(bool commandEvents)
+ SCI_GETCOMMANDEVENTS → bool
SCI_SETMOUSEDWELLTIME(int periodMilliseconds)
SCI_GETMOUSEDWELLTIME → int
SCI_SETIDENTIFIER(int identifier)
@@ -7750,7 +7752,9 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber);
EN_CHANGE). No other information is sent. If you need more detailed information
use SCN_MODIFIED. You can filter the
types of changes you are notified about with SCI_SETMODEVENTMASK.
+ href="#SCI_SETMODEVENTMASK">SCI_SETMODEVENTMASK and
+ SCI_SETCOMMANDEVENTS.
SCI_SETMODEVENTMASK(int eventMask)
SCI_GETMODEVENTMASK → int
@@ -7770,6 +7774,14 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber);
SC_MOD_BEFOREINSERT, SC_MOD_BEFOREDELETE,
SC_MULTILINEUNDOREDO, and SC_MODEVENTMASKALL.
+ SCI_SETCOMMANDEVENTS(bool commandEvents)
+ SCI_GETCOMMANDEVENTS → bool
+ These messages set and get whether SCEN_* command events are
+ sent to the container. For SCEN_CHANGE this acts as an additional filter over
+ .
+ Most applications should set this off to avoid overhead and only use
+ .
+
SCEN_SETFOCUS
SCEN_KILLFOCUS
SCEN_SETFOCUS (512) is fired when Scintilla receives focus and
diff --git a/scintilla/doc/ScintillaHistory.html b/scintilla/doc/ScintillaHistory.html
index 4b6b8926d..7e2fc7e2e 100644
--- a/scintilla/doc/ScintillaHistory.html
+++ b/scintilla/doc/ScintillaHistory.html
@@ -551,6 +551,10 @@
Release 4.1.3
+ -
+ Add SCI_SETCOMMANDEVENTS API to allow turning off command events as they
+ can be a significant performance cost.
+
-
Fixed a crash on Cocoa in bidirectional mode where some patterns of invalid UTF-8
caused failures to create Unicode strings.
diff --git a/scintilla/include/Scintilla.h b/scintilla/include/Scintilla.h
index 9b452c70a..5ef01dd2d 100644
--- a/scintilla/include/Scintilla.h
+++ b/scintilla/include/Scintilla.h
@@ -103,8 +103,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_IME_INLINE 1
#define SCI_GETIMEINTERACTION 2678
#define SCI_SETIMEINTERACTION 2679
-#define SCI_ISIMEOPEN 2717
-#define SCI_ISIMEMODECJK 2718
+#define SCI_ISIMEOPEN 2719
+#define SCI_ISIMEMODECJK 2720
#define MARKER_MAX 31
#define SC_MARK_CIRCLE 0
#define SC_MARK_ROUNDRECT 1
@@ -703,6 +703,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_RELEASEDOCUMENT 2377
#define SCI_GETDOCUMENTOPTIONS 2379
#define SCI_GETMODEVENTMASK 2378
+#define SCI_SETCOMMANDEVENTS 2717
+#define SCI_GETCOMMANDEVENTS 2718
#define SCI_SETFOCUS 2380
#define SCI_GETFOCUS 2381
#define SC_STATUS_OK 0
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface
index a8e60baa6..b0efce43d 100644
--- a/scintilla/include/Scintilla.iface
+++ b/scintilla/include/Scintilla.iface
@@ -267,8 +267,8 @@ get int GetIMEInteraction=2678(,)
set void SetIMEInteraction=2679(int imeInteraction,)
# >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
-get bool IsIMEOpen=2717(,)
-get bool IsIMEModeCJK=2718(,)
+get bool IsIMEOpen=2719(,)
+get bool IsIMEModeCJK=2720(,)
# <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
enu MarkerSymbol=SC_MARK_
@@ -1813,6 +1813,12 @@ get int GetDocumentOptions=2379(,)
# Get which document modification events are sent to the container.
get int GetModEventMask=2378(,)
+# Set whether command events are sent to the container.
+set void SetCommandEvents=2717(bool commandEvents,)
+
+# Get whether command events are sent to the container.
+get bool GetCommandEvents=2718(,)
+
# Change internal focus flag.
set void SetFocus=2380(bool focus,)
# Get internal focus flag.
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx
index c2eb315a4..309c9acd2 100644
--- a/scintilla/src/Editor.cxx
+++ b/scintilla/src/Editor.cxx
@@ -181,6 +181,7 @@ Editor::Editor() {
needIdleStyling = false;
modEventMask = SC_MODEVENTMASKALL;
+ commandEvents = true;
pdoc->AddWatcher(this, 0);
@@ -2677,9 +2678,11 @@ void Editor::NotifyModified(Document *, DocModification mh, void *) {
// If client wants to see this modification
if (mh.modificationType & modEventMask) {
- if ((mh.modificationType & (SC_MOD_CHANGESTYLE | SC_MOD_CHANGEINDICATOR)) == 0) {
- // Real modification made to text of document.
- NotifyChange(); // Send EN_CHANGE
+ if (commandEvents) {
+ if ((mh.modificationType & (SC_MOD_CHANGESTYLE | SC_MOD_CHANGEINDICATOR)) == 0) {
+ // Real modification made to text of document.
+ NotifyChange(); // Send EN_CHANGE
+ }
}
SCNotification scn = {};
@@ -7665,6 +7668,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_GETMODEVENTMASK:
return modEventMask;
+ case SCI_SETCOMMANDEVENTS:
+ commandEvents = static_cast
(wParam);
+ return 0;
+
+ case SCI_GETCOMMANDEVENTS:
+ return commandEvents;
+
case SCI_CONVERTEOLS:
pdoc->ConvertLineEnds(static_cast(wParam));
SetSelection(sel.MainCaret(), sel.MainAnchor()); // Ensure selection inside document
diff --git a/scintilla/src/Editor.h b/scintilla/src/Editor.h
index 3135b0ddd..5a4de2588 100644
--- a/scintilla/src/Editor.h
+++ b/scintilla/src/Editor.h
@@ -229,6 +229,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
bool needIdleStyling;
int modEventMask;
+ bool commandEvents;
SelectionText drag;
diff --git a/scintilla/win32/ScintillaWin.cxx b/scintilla/win32/ScintillaWin.cxx
index 28c3d83bf..fe282ef54 100644
--- a/scintilla/win32/ScintillaWin.cxx
+++ b/scintilla/win32/ScintillaWin.cxx
@@ -2120,9 +2120,11 @@ void ScintillaWin::NotifyChange() noexcept {
}
void ScintillaWin::NotifyFocus(bool focus) {
- ::SendMessage(::GetParent(MainHWND()), WM_COMMAND,
- MAKELONG(GetCtrlID(), focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS),
- reinterpret_cast(MainHWND()));
+ if (commandEvents) {
+ ::SendMessage(::GetParent(MainHWND()), WM_COMMAND,
+ MAKELONG(GetCtrlID(), focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS),
+ reinterpret_cast(MainHWND()));
+ }
Editor::NotifyFocus(focus);
}
diff --git a/src/Encoding.h b/src/Encoding.h
index be8fce3e7..38e75c94a 100644
--- a/src/Encoding.h
+++ b/src/Encoding.h
@@ -4,32 +4,17 @@
* Notepad3 *
* *
* Encoding.h *
+* General helper functions *
+* Based on code from Notepad2, (c) Florian Balmer 1996-2011 *
+* Parts taken from SciTE, (c) Neil Hodgson *
+* MinimizeToTray, (c) 2000 Matthew Ellis *
* *
-* Copyright (C) 2006-2016 Wu Yongwei *
-* *
-* This software is provided 'as-is', without any express or implied *
-* warranty. In no event will the authors be held liable for any *
-* damages arising from the use of this software. *
-* *
-* Permission is granted to anyone to use this software for any purpose, *
-* including commercial applications, and to alter it and redistribute *
-* it freely, subject to the following restrictions: *
-* *
-* 1. The origin of this software must not be misrepresented; you must *
-* not claim that you wrote the original software. If you use this *
-* software in a product, an acknowledgement in the product *
-* documentation would be appreciated but is not required. *
-* 2. Altered source versions must be plainly marked as such, and must *
-* not be misrepresented as being the original software. *
-* 3. This notice may not be removed or altered from any source *
-* distribution. *
-* *
-* *
-* The latest version of this software should be available at: *
-* *
+* (c) Rizonesoft 2008-2018 *
+* https://rizonesoft.com *
* *
* *
*******************************************************************************/
+
#pragma once
#ifndef _NP3_ENCODING_H_
#define _NP3_ENCODING_H_
diff --git a/src/Helpers.c b/src/Helpers.c
index 991af3fd9..23594c836 100644
--- a/src/Helpers.c
+++ b/src/Helpers.c
@@ -6,10 +6,10 @@
* Helpers.c *
* General helper functions *
* Based on code from Notepad2, (c) Florian Balmer 1996-2011 *
-* Parts taken from SciTE, (c) Neil Hodgson *
-* MinimizeToTray, (c) 2000 Matthew Ellis *
+* Parts taken from SciTE, (c) Neil Hodgson *
+* MinimizeToTray, (c) 2000 Matthew Ellis *
* *
-* (c) Rizonesoft 2008-2016 *
+* (c) Rizonesoft 2008-2018 *
* https://rizonesoft.com *
* *
* *
diff --git a/src/Notepad3.c b/src/Notepad3.c
index 7f973cdd2..9719ae88d 100644
--- a/src/Notepad3.c
+++ b/src/Notepad3.c
@@ -1543,7 +1543,9 @@ static void _InitializeSciEditCtrl(HWND hwndEditCtrl)
// SC_PERFORMED_UNDO, SC_PERFORMED_REDO, SC_MULTISTEPUNDOREDO, SC_LASTSTEPINUNDOREDO, SC_MOD_CHANGEMARKER,
// SC_MOD_BEFOREINSERT, SC_MOD_BEFOREDELETE, SC_MULTILINEUNDOREDO, and SC_MODEVENTMASKALL.
//
- ///~ Don't use: SC_PERFORMED_USER | SC_MOD_CHANGESTYLE;
+ ///~ Don't use: SC_PERFORMED_USER | SC_MOD_CHANGESTYLE;
+ /// SC_MOD_CHANGESTYLE and SC_MOD_CHANGEINDICATOR needs SCI_SETCOMMANDEVENTS=true
+
int const evtMask1 = SC_MOD_CONTAINER | SC_PERFORMED_UNDO | SC_PERFORMED_REDO;
int const evtMask2 = SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT | SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE;
@@ -1564,7 +1566,8 @@ static void _InitializeSciEditCtrl(HWND hwndEditCtrl)
SendMessage(hwndEditCtrl, SCI_SETADDITIONALCARETSVISIBLE, true, 0);
SendMessage(hwndEditCtrl, SCI_SETVIRTUALSPACEOPTIONS, SCVS_NONE, 0);
SendMessage(hwndEditCtrl, SCI_SETLAYOUTCACHE, SC_CACHE_PAGE, 0);
-
+ SendMessage(hwndEditCtrl, SCI_SETCOMMANDEVENTS, false, 0); // SCI 4.1.3 : speedup folding
+
// assign command keys
SendMessage(hwndEditCtrl, SCI_ASSIGNCMDKEY, (SCK_NEXT + (SCMOD_CTRL << 16)), SCI_PARADOWN);
SendMessage(hwndEditCtrl, SCI_ASSIGNCMDKEY, (SCK_PRIOR + (SCMOD_CTRL << 16)), SCI_PARAUP);
diff --git a/src/StyleLexers/EditLexer.h b/src/StyleLexers/EditLexer.h
index 244fb96b8..c504d355c 100644
--- a/src/StyleLexers/EditLexer.h
+++ b/src/StyleLexers/EditLexer.h
@@ -32,7 +32,7 @@ typedef __int64 (*LexFunctionPtr_t)(LexFunctionType type, int value);
typedef struct _editstyle
{
-#pragma warning(disable : 4201) // MS's Non-Std: Struktur/Union ohne Namen
+#pragma warning(disable : 4201) // MS's Non-Std: Structure/Union w/o name
union
{
INT32 iStyle;
@@ -53,7 +53,7 @@ typedef struct _keywordlist
} KEYWORDLIST, *PKEYWORDLIST;
-#pragma warning(disable : 4200) // MS's Non-Std: Null-Array in Struktur/Union
+#pragma warning(disable : 4200) // MS's Non-Std: Null-Array in Structure/Union
typedef struct _editlexer
{
int lexerID;
diff --git a/src/Version.h b/src/Version.h
index 11bb53339..ddd4e9a6e 100644
Binary files a/src/Version.h and b/src/Version.h differ