Skip to content

Relative Positions #13230

Answered by Abe27342
jclem asked this question in Q&A
Dec 5, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Thanks for the ping @tylerbutler --I do :).

One major question:

This is quite tricky, because decorations in CodeMirror are not part of the document content.

Are these decorations not collaborative or persisted cross-session at all? or am I misunderstanding something about the use case?

If they are truly some transient state that needs to only exist locally, I'd recommend using local references. This is what we're currently recommending people use to power their undo-redo stack, for example.

If you do need some kind of persistence in the document model, I'd recommend using the interval collection API. You can associate intervals to a range of characters on your SharedString. When the st…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jclem
Comment options

Answer selected by jclem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants