The TextEditor.onWillSave
does not seem to honor the 5 second rule. TextEditor - Nova
I am starting a Process in the callback function to format/transform the text, I then take the text and use TextEditor.edit
to replace the entire contents of the file. I ultimately return a promise from the callback. I would expect Nova to wait until the contents of the file to update before saving, but it is actually saves, then updates the contents of the file.
Initially I thought the Process was taking longer than 5 seconds to return, resulting in Nova saving the file and then updating after the save, but after profiling the Process, it completes in ~300ms.
Any help or guidance is greatly appreciated.