I am working on a package that would save the state of the workspace (at least the number/order of panes/editors) to be restored later. I’m wondering what the best event(s) to subscribe to for triggering the workspace saving would be.
I would like to update when:
- An editor is added/removed/moved
- An editor pane (ie tab pane) is added/removed/moved
I also want to make sure that if I close the whole window, that it doesn’t cause each editor to emit a closed event and be removed from the saved workspace.
Currently I’ve found the following events that may be useful (taken from https://gist.github.com/ardcore/9262498):
But, this seems like more events than I need. Also, the pane events seem to have the more useful events, but I don’t know if there is an analogous method to atom.workspace.eachEditor() to make sure I subscribe to each pane.
Any suggestions for what the best events to use would be, or the best method to use to react to any changes?