In the lint example (https://prosemirror.net/examples/lint/), we have the following text:
Recomputing the whole set of problems, and recreating the set of decorations, on every change isn’t very efficient, so for production code you might want to consider an approach that can incrementally update these. That’d be quite a bit more complex, but definitely doable—the transaction can give you the information you need to figure out what part of the document changed.
I’d really appreciate any pointers on how to solve for this — to me if it’s not obvious how to do this. Is it enough to just look at the transaction’s selection and update the nodes inside of the selection? To me, that sounds very naïve and unclear if it would work (I can think of a copy-paste would break this attempt).