diff --git a/src/models/transform.js b/src/models/transform.js index 856135c46..b7b62cf1a 100644 --- a/src/models/transform.js +++ b/src/models/transform.js @@ -47,16 +47,17 @@ class Transform { * @property {Boolean} isNative * @property {Boolean} merge * @property {Boolean} save + * @property {Boolean} normalize * @return {State} state */ apply(options = {}) { let transform = this + let { merge, save, isNative = false, normalize = true } = options // Ensure that the state is normalized. - transform = transform.normalize() + if (normalize) transform = transform.normalize() - let { merge, save, isNative = false } = options let { state, operations } = transform let { history } = state let { undos, redos } = history diff --git a/src/plugins/core.js b/src/plugins/core.js index 5220818c8..b2a65082c 100644 --- a/src/plugins/core.js +++ b/src/plugins/core.js @@ -681,7 +681,9 @@ function Plugin(options = {}) { return state .transform() .moveTo(selection) - .apply() + // Since the document has not changed, We only normalize the selection + .normalizeSelection() + .apply({ normalize: false }) } /**