From f23f456a97bacbfda84fba2760f553644bdb7947 Mon Sep 17 00:00:00 2001 From: Marin Sokol Date: Fri, 18 Oct 2024 15:37:03 +0200 Subject: [PATCH] fixing build --- src/edit_session.js | 2 +- src/editor.js | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/edit_session.js b/src/edit_session.js index b806169a0f..53b1dea666 100644 --- a/src/edit_session.js +++ b/src/edit_session.js @@ -126,7 +126,7 @@ class EditSession { this.$operationResetTimer.schedule(); this.curOp = { command: commandEvent.command || {}, - args: commandEvent.args, + args: commandEvent.args }; this.curOp.selectionBefore = this.selection.toJSON(); this._signal("startOperation", commandEvent); diff --git a/src/editor.js b/src/editor.js index 0a907323fe..428b124970 100644 --- a/src/editor.js +++ b/src/editor.js @@ -112,11 +112,9 @@ class Editor { } onStartOperation(commandEvent) { - this.curOp = this.session.curOp = { - ...this.session.curOp, - // scrollTop is kept inside of EditSession only for backwards compatibility reasons - scrollTop: this.renderer.scrollTop - } + // scrollTop is kept inside of session.curOp only for backwards compatibility reasons + this.session.curOp.scrollTop = this.renderer.scrollTop; + this.curOp = this.session.curOp; this.prevOp = this.session.prevOp; if (!commandEvent) { @@ -128,7 +126,7 @@ class Editor { * @arg e */ onEndOperation(e) { - if (this.curOp) { + if (this.curOp && this.session) { if (e && e.returnValue === false) { this.curOp = null; return; @@ -2665,6 +2663,7 @@ class Editor { if (this._$emitInputEvent) this._$emitInputEvent.cancel(); this.removeAllListeners(); + } /**