8
0
Pārlūkot izejas kodu

Log info about similar selection.

Krzysztof Krztoń 8 gadi atpakaļ
vecāks
revīzija
00225497b9
1 mainītis faili ar 13 papildinājumiem un 2 dzēšanām
  1. 13 2
      packages/ckeditor5-engine/src/view/renderer.js

+ 13 - 2
packages/ckeditor5-engine/src/view/renderer.js

@@ -16,6 +16,7 @@ import mix from '@ckeditor/ckeditor5-utils/src/mix';
 import diff from '@ckeditor/ckeditor5-utils/src/diff';
 import insertAt from '@ckeditor/ckeditor5-utils/src/dom/insertat';
 import remove from '@ckeditor/ckeditor5-utils/src/dom/remove';
+import log from '@ckeditor/ckeditor5-utils/src/log';
 import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
 import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 
@@ -577,8 +578,18 @@ export default class Renderer {
 		const domSelection = domRoot.ownerDocument.defaultView.getSelection();
 		const oldViewSelection = domSelection && this.domConverter.domSelectionToView( domSelection );
 
-		if ( oldViewSelection && ( this.selection.isEqual( oldViewSelection ) ||
-			this._areSimilarSelections( oldViewSelection, this.selection ) ) ) {
+		if ( oldViewSelection && this.selection.isEqual( oldViewSelection ) ) {
+			return;
+		}
+
+		if ( oldViewSelection && this._areSimilarSelections( oldViewSelection, this.selection ) ) {
+			const data = {
+				oldSelection: oldViewSelection,
+				currentSelection: this.selection
+			};
+
+			log.warn( 'renderer-selection-similar: Rendering selection was skipped due to its similarity to the previous selection.', data );
+
 			return;
 		}