I initially ripped out Atom::getLoadSettings in favor of a mutable
property because window spec was making an assumption that such a
property existed anyway. Since load settings need to be available from
class methods, the instance method just delegates to the class method.
But that means there's no ::loadSettings property to mutate in that
spec. I replaced the former approach with a spy which has the added
advantage of not polluting windowSettings for subsequent specs.
We call atom.destroyOrphans after each spec now to clean up any orphaned
objects. Previously, we we destroying any object not reachable from the
root document. This was causing children of orphaned objects to be
removed from their parent, which caused null pointer exceptions when
running the destroy handlers for the orphans. Now we only destroy the
roots of orphaned object graphs.
Previously the display was changed to none via $.hide() which accidentally
affected the ability of package's to serialize DOM properties such as
scrollTop since the value would always be zero when the display was none.
The goal here is to just prevent a flicker when refreshing the
editor window and setting visibility to hidden still accomplishes this.
Addresses #1306
We still need to know why this is happening, so I left an exception in
non-release builds. Since the pane system is about to change a lot I
think this is good enough for now.
We assign a value into ::loadSettings anyway in a spec, so there's not
much point leaving it a method. Eventually I'd like to pass all these
settings in when constructing the Atom object and eliminate awareness
of the loadSettings altogether from the Atom global.
Previously, it would blindly read from disk on reload, and set the text
into the editor. This was problematic as it would mess with markers and
folds. No longer.
Fixes#1285 and fixesatom/bookmarks#3