From bb52fa5b185b178683dff2e7bc650e0108b0daad Mon Sep 17 00:00:00 2001 From: Viktor Hesselbom Date: Tue, 3 Nov 2020 16:23:37 +0100 Subject: [PATCH] Add { scroll: false } when resetting user cursor to prevent jump when other clients update --- src/y-codemirror.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/y-codemirror.js b/src/y-codemirror.js index eb5043a..30e8eeb 100644 --- a/src/y-codemirror.js +++ b/src/y-codemirror.js @@ -74,7 +74,7 @@ const typeObserver = (binding, event) => { head = anchor anchor = tmp } - cm.setSelection(cm.posFromIndex(anchor), cm.posFromIndex(head)) + cm.setSelection(cm.posFromIndex(anchor), cm.posFromIndex(head), { scroll: false }) }) }