PlainEditor: Return TextModification when the buffer is modified#433
PlainEditor: Return TextModification when the buffer is modified#433axelkar wants to merge 1 commit intolinebender:mainfrom
Conversation
|
Hmm. I'm not sure how to reason about whether we want to add this. I do think that in general collaborative editing is probably out of scope for That being said, I think a very similar approach would be useful for getting basic undo/redo support landed, which I do think would be in scope for PlainEditor (see also linebender/xilem#1417). I can see that in that case you'd also want the modified content (both added and removed, I guess), and to keep track of the cursor position. I think that should be a relatively small addition on top of this code. If we were to do something like that, I'd like to see basic undo/redo added to the |
That wouldn't even need this, or integration in Parley at all. You can just keep a As an unrelated question, are custom inline elements supported in PlainEditor's layout? I haven't diven that deep. |
I believe not. There was some work towards making that possible (mostly around selections and cursors), but it never got as far as actually working. |
|
We discussed this in office hours, and the consensus position was that this is a reasonable feature to have here.
That feels very memory inefficient to me. Another reason that you might want tighter integration in the editor is so that your history mechanism can e.g. delete characters, then words. But I still agree, that this PR isn't designed for that use case. |
This is useful for collaborative text editing as user intent is very easily lost when just diffing text.
Should
#[must_use]be placed onTextModification?