Since my plugin sometimes has to operate on a different views, sometimes wanting to do several edits in sequence I had to build in an event system and make my own editing text commands so i could chain editing commands via callbacks pushed through my own event system. This is due to the fact that editing commands all run async so i cant easily delete some text, then insert something else, then do something else on the buffer as the insert and delete may not have completed yet.
It would be amazing if there were a way to do this built in to the system. A sort of promises like chaining pattern or something. I know others have run into this as well.