kopia lustrzana https://github.com/c9/core
Fixes c9/core+110 always use close() when unloading tabs
rodzic
f52d889cbf
commit
a52b93b35d
|
@ -289,6 +289,15 @@ define(function(require, module, exports) {
|
|||
load();
|
||||
});
|
||||
|
||||
plugin.on("beforeUnload", function(){
|
||||
if (!plugin.meta.$closing) {
|
||||
plugin.document.meta.$ignoreSave = true;
|
||||
close();
|
||||
delete plugin.document.meta.$ignoreSave;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
plugin.on("unload", function(e) {
|
||||
closed = true;
|
||||
|
||||
|
|
|
@ -132,11 +132,8 @@ define(function(require, module, exports) {
|
|||
function removeTab(e) {
|
||||
if (!e.error) {
|
||||
var tab = findTab(e.path);
|
||||
if (tab) {
|
||||
tab.document.meta.$ignoreSave = true;
|
||||
tab.close();
|
||||
delete tab.document.meta.$ignoreSave;
|
||||
}
|
||||
if (tab)
|
||||
tab.unload();
|
||||
}
|
||||
}
|
||||
fs.on("afterUnlink", removeTab);
|
||||
|
@ -145,9 +142,8 @@ define(function(require, module, exports) {
|
|||
var path = e.path;
|
||||
Object.keys(tabs).forEach(function(id) {
|
||||
var tab = tabs[id];
|
||||
if (tab.path && tab.path.indexOf(path) === 0) {
|
||||
if (tab.path && tab.path.indexOf(path) === 0)
|
||||
tab.unload();
|
||||
}
|
||||
});
|
||||
});
|
||||
// Close a pane when it doesn't open
|
||||
|
|
Ładowanie…
Reference in New Issue