fix c9 open --wait

pull/385/head
nightwing 2016-11-24 22:43:34 +00:00
rodzic 18dea5502f
commit c4500a1abc
1 zmienionych plików z 10 dodań i 10 usunięć

Wyświetl plik

@ -63,9 +63,9 @@ define(function(require, exports, module) {
}, plugin); }, plugin);
prefs.add({ prefs.add({
"Editors" : { "Editors": {
"Terminal" : { "Terminal": {
"Use Cloud9 as the Default Editor" : { "Use Cloud9 as the Default Editor": {
type: "checkbox", type: "checkbox",
path: "user/terminal/@defaultEnvEditor", path: "user/terminal/@defaultEnvEditor",
position: 14000 position: 14000
@ -77,12 +77,12 @@ define(function(require, exports, module) {
/***** Methods *****/ /***** Methods *****/
function createPipe(message, callback) { function createPipe(message, callback) {
tabManager.once("ready", function(){ tabManager.once("ready", function() {
tabManager.open({ tabManager.open({
focus: true, focus: true,
editorType: "ace", editorType: "ace",
path: message.path && c9.toInternalPath(message.path), path: message.path && c9.toInternalPath(message.path),
document: { meta : { newfile: true } } document: { meta: { newfile: true } }
}, function(err, tab) { }, function(err, tab) {
if (err) if (err)
return callback(err); return callback(err);
@ -96,7 +96,7 @@ define(function(require, exports, module) {
var tab = tabManager.findTab(message.tab); var tab = tabManager.findTab(message.tab);
var c9Session = tab && tab.document.getSession(); var c9Session = tab && tab.document.getSession();
if (c9Session && c9Session.session) if (c9Session && c9Session.session)
c9Session.session.insert({row: Number.MAX_VALUE, column: Number.MAX_VALUE} , message.data); c9Session.session.insert({row: Number.MAX_VALUE, column: Number.MAX_VALUE} , message.data);
callback(null, true); callback(null, true);
}); });
} }
@ -152,13 +152,13 @@ define(function(require, exports, module) {
focus: i === 0, focus: i === 0,
document: existing document: existing
? { ace: { jump: jump } } ? { ace: { jump: jump } }
: { meta : { newfile: true } } : { meta: { newfile: true } }
}, function(){ }, function(){
next(); setTimeout(next); // TabManager calls this before returning the tab!
}); });
if (message.wait) { if (message.wait) {
tab.on("close", function(){ tab.on("close", function() {
tabs.splice(tabs.indexOf(tab), 1); tabs.splice(tabs.indexOf(tab), 1);
if (!tabs.length) if (!tabs.length)
callback(null, true); callback(null, true);
@ -169,7 +169,7 @@ define(function(require, exports, module) {
}); });
}); });
} }
}, function(err){ }, function(err) {
if (err) if (err)
return callback(err); return callback(err);