Skip to content

Commit 9747e35

Browse files
committed
Do not reload unicode if it did not change
1 parent 2c61bb7 commit 9747e35

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jupyter_ydoc/yunicode.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ def set(self, value: str) -> None:
6363
:param value: The content of the document.
6464
:type value: str
6565
"""
66+
if self.get() == value:
67+
# no-op if the values are already the same,
68+
# to avoid side-effects such as cursor jumping to the top
69+
return
6670
with self._ydoc.transaction():
6771
# clear document
6872
self._ysource.clear()

0 commit comments

Comments
 (0)