atom / tabs

Tabs in Atom
MIT License
111 stars 115 forks source link

Don't try to copy items by serializing and deserializing them #522

Closed maxbrunsfeld closed 6 years ago

maxbrunsfeld commented 6 years ago

Fixes https://github.com/atom/tabs/issues/234

Previously, when splitting an item using its tab's context menu, if the item did not have a .copy() method, we would try to copy the item by serializing it and then deserializing the serialized state. The problem with this is that for some items (e.g. the tree-view), deserialization always returns the same instance.

I think it's more explicit for copyable items to just implement a .copy() method. Before releasing this change, I need to add a .copy method to some of Atom's pane item classes: