Prevent multiple instances of tree-view being opened#1283
Prevent multiple instances of tree-view being opened#1283shadow-light wants to merge 1 commit intoatom:masterfrom
Conversation
|
Reproduction steps:
|
|
@shadow-light can you add a regression test for this? |
|
Sure, I can try. Can you point me to a similar one that I can learn from? |
|
@shadow-light I took a look at what tests we have now for package activation and it looks like there's nothing similar. If you'd prefer, I can try adding the test for you. Otherwise, here's what I'm thinking: The tree-view setup is done here. You can probably add a test in the "package activation" section that gets the active pane of the dock and splits it. Then require tree-view and |
|
If you don't mind adding it for me that would be great. Mainly because I'm not too familiar with Atom's API and already couldn't figure out how to do some things in my init script 😆 |
Description of the Change
Currently tree-view opens itself with a call to
atom.workspace.openwhich by default: "only the active pane will be searched for an existing item"When the left dock is split, only the bottom pane of that dock is searched, and if tree-view already exists in another pane then two instances of tree-view are opened. Initially the duplicate instance is blank, but upon restarting atom it causes atom to crash with
Error: The workspace can only contain one instance of item.Alternate Designs
None
Benefits
Atom doesn't crash
Possible Drawbacks
None
Applicable Issues
This should fix: