The general idea is that you keep your decorations in a plugin state field, and have your decorations
method just read it from there, rather than rebuild it on every transaction. The field’s apply
method maps the old decoration set when there are any changes, and updates the regions touched by the transaction’s steps (which you can get by iterating over their step maps, as found in tr.mapping
).
2 Likes