So, as part of my ongoing project, I decided I wanted a little routine that would wait for the “on_pre_save” event and update a field in the header named "Last updated: ". I did fine with finding and altering the string, however I realized that the on_pre_save method doesn’t receive an edit object. It receives the current view object, but not the edit object that you normally get with a TextCommand plugin.
And then I found a paragraph in the Unofficial Documentation that states “Plugin creators must ensure that all modifying operations occur inside the .run method of new text commands.”
Am I correct in thinking that 1) I cannot directly get an edit object for the view that I’m receiving and do the editing in the event method but 2) can create a command that does this, and then inside of “on_pre_save” I issue the view.run_command(“name”)? I will try the latter, but I’m asking the question in case I’m missing out on an easier method for obtaining an edit object for the view and can just do it all in the listener method.