瀏覽代碼

Call SCI_SETMODEVENTMASK to disable unwanted SCN_MODIFIED notifications.

Martijn Laan 1 年之前
父節點
當前提交
d6c14df3be
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 2 0
      Components/ScintEdit.pas
  2. 0 1
      Projects/Src/CompScintEdit.pas

+ 2 - 0
Components/ScintEdit.pas

@@ -685,6 +685,7 @@ begin
     Error('CreateWnd: FDirectPtr is nil');
     Error('CreateWnd: FDirectPtr is nil');
   UpdateCodePage;
   UpdateCodePage;
   Call(SCI_SETCOMMANDEVENTS, 0, 0);
   Call(SCI_SETCOMMANDEVENTS, 0, 0);
+  Call(SCI_SETMODEVENTMASK, SC_MOD_INSERTTEXT or SC_MOD_DELETETEXT, 0);
   Call(SCI_SETCARETPERIOD, GetCaretBlinkTime, 0);
   Call(SCI_SETCARETPERIOD, GetCaretBlinkTime, 0);
   Call(SCI_SETSCROLLWIDTHTRACKING, 1, 0);
   Call(SCI_SETSCROLLWIDTHTRACKING, 1, 0);
   { The default popup menu conflicts with the VCL's PopupMenu on Delphi 3 }
   { The default popup menu conflicts with the VCL's PopupMenu on Delphi 3 }
@@ -1141,6 +1142,7 @@ begin
       end;
       end;
     SCN_MODIFIED:
     SCN_MODIFIED:
       begin
       begin
+        { CreateWnd limits SCN_MODIFIED to INSERTTEXT and DELETETEXT }
         if N.modificationType and SC_MOD_INSERTTEXT <> 0 then
         if N.modificationType and SC_MOD_INSERTTEXT <> 0 then
           Change(True, N.position, N.length, N.linesAdded)
           Change(True, N.position, N.length, N.linesAdded)
         else if N.modificationType and SC_MOD_DELETETEXT <> 0 then
         else if N.modificationType and SC_MOD_DELETETEXT <> 0 then

+ 0 - 1
Projects/Src/CompScintEdit.pas

@@ -143,7 +143,6 @@ begin
      to Alt+Click? And Alt+Shift+Drag instead of Alt+Drag for rect select?
      to Alt+Click? And Alt+Shift+Drag instead of Alt+Drag for rect select?
     -What about using Calltips and SCN_DWELLSTART to show variable evalutions?
     -What about using Calltips and SCN_DWELLSTART to show variable evalutions?
     -Should turn on DISABLE_D2D compiler directive in isscint build?
     -Should turn on DISABLE_D2D compiler directive in isscint build?
-    -Should call SCI_SETMODEVENTMASK
     -Add folding support?
     -Add folding support?
     -3.6.6: Investigate SCFIND_CXX11REGEX: C++ 11 <regex> support built by default.
     -3.6.6: Investigate SCFIND_CXX11REGEX: C++ 11 <regex> support built by default.
             Can be disabled by defining NO_CXX11_REGEX. Good (?) overview at:
             Can be disabled by defining NO_CXX11_REGEX. Good (?) overview at: