In the different examples from the documentation, the pattern is usually to have a StateField to store the decoration ranges (for instance
underlineField), a StateEffect to dispatch the changes (for instance
underlineEffect) and a Decoration object (for instance
underlineMark) used by the StateField to create the ranges according to the StateEffect.
This is fine when the decoration object is independent from the changes. In my case it’s not, and I was wondering if it would be ok to instantiate this object ob the fly inside the
StateField::update method or if that would lead to a dangling reference.