-
-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Codemirror treats the line separator \r\n
as a single character which means ranges and positions are different from yjs.
If a file contains \r\n
then new characters written after it appear correctly in codemirror but are actually added at the wrong position in the yjs document.
Also adding text directly to the end of the yjs document throws an error because the change will be out of range for codemirror.
It seems like \r\n
being only one character is intended behavior for codemirror and positions should be manually adjusted.
To Reproduce
Steps to reproduce the behavior:
- Create a file containing
1\r\n2
where\r\n
is a line separator, not normal text. - Write another character at the end, it will appear as
1\r\n23
in codemirror but1\r\n32
in yjs. - Inserting a character at the end of the yjs doc throws a range error when the change is dispatched here.
Expected behavior
Ranges and positions are always consistent between yjs and codemirror.
Environment Information
- Chromium / Node.js
- Yjs v13.6.15
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working