From d5041462a1f1a1a379dee5269ffff568461ed710 Mon Sep 17 00:00:00 2001 From: Roeland Bosch Date: Tue, 19 May 2020 11:44:45 +0200 Subject: [PATCH] Rename current cursor to local cursor --- src/plugins/sync-plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/sync-plugin.js b/src/plugins/sync-plugin.js index faaf802..a76862e 100644 --- a/src/plugins/sync-plugin.js +++ b/src/plugins/sync-plugin.js @@ -253,7 +253,7 @@ export class ProsemirrorBinding { this._domSelectionInView = null } - _isCurrentCursorInView() { + _isLocalCursorInView() { if (!this.prosemirrorView.hasFocus()) return false if (environment.isBrowser && this._domSelectionInView === null) { // Calculte the domSelectionInView and clear by next tick after all events are finished @@ -362,7 +362,7 @@ export class ProsemirrorBinding { let tr = this.prosemirrorView.state.tr.replace(0, this.prosemirrorView.state.doc.content.size, new PModel.Slice(new PModel.Fragment(fragmentContent), 0, 0)) restoreRelativeSelection(tr, this.beforeTransactionSelection, this) tr = tr.setMeta(ySyncPluginKey, { isChangeOrigin: true }) - if (this.beforeTransactionSelection !== null && this._isCurrentCursorInView()) { + if (this.beforeTransactionSelection !== null && this._isLocalCursorInView()) { tr.scrollIntoView() } this.prosemirrorView.dispatch(tr)