Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Added prevent option to ::onWillDestroyPaneItem() #13812
Description of the Change
This PR implements the feature requested in issue #12376. It adds a method to the parameter of the
An alternative for the requested feature overall isn't really present, as the previous implementation would close the tab no matter what or request the user to safe in case of unsaved changes. Both of these are unwanted behaviour as described in #12376.
As for alternative ways to implement the functionality, I considered
Why Should This Be In Core?
As explained in #12376, the problem is that it isn't part of the core. As of now it is nearly impossible to implement this as a package, and non of the solutions I could think of are even remotely elegant (e.g. recording what tab(s) closed and reopening them after they've been closed).
It will help developers of packages prevent the unwanted closing of "special" tabs e.g. when "Close all tabs" is called by the user. This has, for example, been requested in this issue on one of my own packages.
When used incorrectly this functionality could make closing tabs impossible for users. However, simply disabling the package that uses this functionality incorrectly will solve the problem.
added a commit
this pull request
Feb 14, 2017
referenced this pull request
Feb 28, 2017
@50Wliu (or anyone else), I was wonder if you could help me here?
After I pushed some commits to this PR yesterday all CI systems have failed for some mysterious reason, I can build Atom locally. Also, the logs do not point to something related to my changes, but instead to a build issue related to node-gyp (see AppVeyor)... Maybe it possible to restart the CI systems?