Martijn Laan 3 днів тому
батько
коміт
8029a306b8
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      Components/ScintEdit.pas

+ 4 - 0
Components/ScintEdit.pas

@@ -790,6 +790,10 @@ begin
   SetSavePoint;
   SetSavePoint;
   Call(SCI_EMPTYUNDOBUFFER, 0, 0);
   Call(SCI_EMPTYUNDOBUFFER, 0, 0);
 
 
+  { Clearing change history requires one to disable and re-enable it. But
+    also, from Scintilla docs: "Change history depends on the undo history
+    and can only be enabled when undo history is enabled and empty." This
+    is why the following code is here. }
   if ClearChangeHistory and (FChangeHistory <> schDisabled) then begin
   if ClearChangeHistory and (FChangeHistory <> schDisabled) then begin
     Call(SCI_SETCHANGEHISTORY, SC_CHANGE_HISTORY_DISABLED, 0);
     Call(SCI_SETCHANGEHISTORY, SC_CHANGE_HISTORY_DISABLED, 0);
     var Flags := SC_CHANGE_HISTORY_ENABLED;
     var Flags := SC_CHANGE_HISTORY_ENABLED;