Przeglądaj źródła

Docs: Added better explanation for `UndoEngine` mechanism.

Szymon Cofalik 8 lat temu
rodzic
commit
070eb4392d
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      packages/ckeditor5-undo/src/undoengine.js

+ 3 - 0
packages/ckeditor5-undo/src/undoengine.js

@@ -68,6 +68,9 @@ export default class UndoEngine extends Plugin {
 
 			// Do not register batch if the operation is not a document operation.
 			// This prevents from creating empty undo steps, where all operations where non-document operations.
+			// Non-document operations creates and alters content in detached tree fragments (for example, document fragments).
+			// Most of time this is preparing data before it is inserted into actual tree (for example during copy & paste).
+			// Such operations should not be reversed.
 			if ( !operation.isDocumentOperation ) {
 				return;
 			}