Is there an extension (or even built in functions) for applying “standard” text diff patches to content in an editor, so that you don’t have to grab the content as string, patch that, then overwrite the content with that update?
E.g. is there something that can simply be fed a patch like:
--- a/old_file.txt
+++ b/new_file.txt
@@ -1,3 +1,4 @@
This is the first line.
-This line will be deleted.
+This line will be added.
This is the third line.
+This is another new line.
and then updates only the relevant stretches of document, rather than needing something like
const current = editor.state.doc.toString();
const updated = applyPatch(current, patch);
editor.dispatch({
changes: {
from: 0,
to: current.length,
insert: updated,
},
});