`onDidChangeActivePaneItem` is called synchronously when the active pane
item changes, and several non-critical actions preform work on that
event. Critical UI feedback, like changing the active tab, needs to
happen synchronously, but most other functionality should be run
asynchronously.
Previously, these registrations were scattered all over the codebase and
required that `global.atom` be defined, which creating weird ordering
issues. Registering them all from the global makes the relationships
clearer and means we don’t have to assign a global to set up a fully-
functional environment.
Previously an editor that was split into multiple panes would not
prompt to save correctly when the window was unloading.
This adds a new `windowCloseRequested` option passed through from the
beforeunload handler to the editor so that it can specially handle this
case.
Closes#5257
It now takes two arguments, a model constructor and a create view
callback that is passed the model.
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Removed various ::getView methods from the model. Using the atom.views
global in the views for now, but going to switch them over to using a
locally assigned view registry instead in a subsequent commit.
This is the next step on converting all internal views to custom
elements instead of using SpacePen. The TextEditorElement instances
are associated with ::__spacePenView fields that are used for supporting
legacy access paths via atom.workspaceView.
Fixes#2694
Fixel #2853
Previously, we were storing an `active` boolean for each pane. We've
had some strange bugs where every pane is serializing `active: false`,
which causes exceptions when loading up the stored data.
This new approach serializes the activePaneId on the PaneContainer
itself. Since the PaneContainer is the source of truth regarding the
active pane, it makes more sense to handle it here.
This unfortunately changes the serialization version for the
PaneContainer, so people won't have their state persisted after
upgrading. But it seems better than leaving cruft to handle the old
serialization situation.