-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to enable/disable normailze quill delta #2
Comments
What is the use-case for this? Or do you encounter any problems because the newline is removed? If you disable this behavior, then you will encounter weird behavior, since every clients start with a document that has a newline. Assume you have two clients starting with "\n", then the merged document will be two lines long. So every new client will add a newline item above or below the document. Another unfortunate behavior is that users often add more newlines to have more space where they can add content. When syncing offline changes, these added newlines will add up to a huge document. Maybe this behavior can be optimized by only removing the initial newline. I remember that this was my initial plan. I gave up eventually because of some problem. You are welcome to create a PR to yjs/yjs to fix this behavior in Y.Text. Although I would prefer a generic solution. |
In my case,
and I found in YText's applyDelta function remove last new line cause of quill I don't konw It can be better solution
|
Hey @Kisama , I gave a pretty lengthy explanation of the reason why the newline is ignored. You just described again that the quill documents have different lengths. This is the expected behavior. |
@dmonad I'm sorry if you feel bad. |
I think I misunderstood you. So you are trying to use YText without y-quill. That makes sense. Sure, you can create a PR that implements an option to disable that behavior in YText. |
@dmonad Thank you so much. The Idea is quite similar but different usecase , I use yjs and y-quill at once and i need to sync new lines even though it’s duplicated. I’ll try to make 2 PRs first is add option quillbinding to enable/disable remove mewline (default is true) and use option before applyDelta, second remove quill related logic in YText’s applyDelta I think the result is same as your idea. If you have any concern please tell me, I try to find another solution. If not , I’ll request PR tomorrow |
Unfortunately we can't remove this behavior from YText because other people might rely on it. No breaking changes. We can make a note to remove this behavior in the next major release though. |
Ok, I got it. In short, remove behavior on YText is impossible but add option to disable behavior is possible. |
Checklist
[ ] Are you reporting a bug? Use github issues for bug reports and feature requests. For general questions, please use https://discuss.yjs.dev/
[ ] Try to report your issue in the correct repository. Yjs consists of many modules. When in doubt, report it to https://github.com/yjs/yjs/issues/
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: