When I am formatting a big document and I change to another document before formatting is finished, formatted text is inserted in the last document.
I suppose the plugin should remember the document where it was invoked to return their results to that document instead to return to the focused document.
Regards.