Im coding a plugin where I need to dynamically replace some placeholders after inserting a snippet.
Im using on_modified eventlistener for this.
So in the on_modified listener Im replacing the placeholder with a UUID.
The problem is that if I undo after the snippet insertion, Im not undoing the snippet insertion but the UUID replacement done by the on_modified handler. So that triggers another on_modified event that replace the placeholder with a new UUID.
In summary, after inserting a snippet, a new UUID is generated, which is fine.
If I press control-z instead of undoing the snippet inertion, Im replacing the UUID with a new UUID.
Is there any way to solve this?
Can I disable “undo” for the on_modified handler?
Thanks