kopia lustrzana https://github.com/c9/core
Add setting for the default editor
rodzic
21b75cb86b
commit
dd8ed52b4f
|
@ -1828,8 +1828,13 @@ module.exports = function setup(fsOptions) {
|
||||||
if (options.idle)
|
if (options.idle)
|
||||||
options.command = "echo '[Idle]'";
|
options.command = "echo '[Idle]'";
|
||||||
|
|
||||||
if (options.terminal)
|
if (options.terminal) {
|
||||||
args.push("export ISOUTPUTPANE=0; export EDITOR='`which c9` open --wait'; " + BASH + " -l");
|
args.push("export ISOUTPUTPANE=0;"
|
||||||
|
+ (options.defaultEditor
|
||||||
|
? " export EDITOR='`which c9` open --wait'; "
|
||||||
|
: "")
|
||||||
|
+ BASH + " -l");
|
||||||
|
}
|
||||||
|
|
||||||
else if (options.command)
|
else if (options.command)
|
||||||
args.push((BASH + " -l -c '"
|
args.push((BASH + " -l -c '"
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
main.consumes = [
|
main.consumes = [
|
||||||
"Plugin", "bridge", "tabManager", "panels",
|
"Plugin", "bridge", "tabManager", "panels", "tree.favorites", "tree",
|
||||||
"tree.favorites", "tree", "fs"
|
"fs", "preferences", "settings"
|
||||||
];
|
];
|
||||||
main.provides = ["bridge.commands"];
|
main.provides = ["bridge.commands"];
|
||||||
return main;
|
return main;
|
||||||
|
@ -13,8 +13,10 @@ define(function(require, exports, module) {
|
||||||
var tabManager = imports.tabManager;
|
var tabManager = imports.tabManager;
|
||||||
var panels = imports.panels;
|
var panels = imports.panels;
|
||||||
var tree = imports.tree;
|
var tree = imports.tree;
|
||||||
|
var settings = imports.settings;
|
||||||
var favs = imports["tree.favorites"];
|
var favs = imports["tree.favorites"];
|
||||||
var fs = imports.fs;
|
var fs = imports.fs;
|
||||||
|
var prefs = imports.preferences;
|
||||||
|
|
||||||
var async = require("async");
|
var async = require("async");
|
||||||
|
|
||||||
|
@ -41,6 +43,24 @@ define(function(require, exports, module) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}, plugin);
|
}, plugin);
|
||||||
|
|
||||||
|
settings.on("read", function(e) {
|
||||||
|
settings.setDefaults("user/terminal", [
|
||||||
|
["defaultEditor", "true"]
|
||||||
|
]);
|
||||||
|
}, plugin);
|
||||||
|
|
||||||
|
prefs.add({
|
||||||
|
"Editors" : {
|
||||||
|
"Terminal" : {
|
||||||
|
"Use Cloud9 as the Default Editor" : {
|
||||||
|
type: "checkbox",
|
||||||
|
path: "user/terminal/@defaultEditor",
|
||||||
|
position: 14000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Methods *****/
|
/***** Methods *****/
|
||||||
|
|
|
@ -750,6 +750,9 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
session.__defineGetter__("tab", function(){ return doc.tab });
|
session.__defineGetter__("tab", function(){ return doc.tab });
|
||||||
session.__defineGetter__("doc", function(){ return doc });
|
session.__defineGetter__("doc", function(){ return doc });
|
||||||
|
session.__defineGetter__("defaultEditor", function(){
|
||||||
|
return settings.getBool("user/terminal/@defaultEditor");
|
||||||
|
});
|
||||||
|
|
||||||
session.attach = function(){
|
session.attach = function(){
|
||||||
if (session.aceSession && aceterm) {
|
if (session.aceSession && aceterm) {
|
||||||
|
|
|
@ -157,6 +157,7 @@ module.exports = function(c9, proc, installPath, shell) {
|
||||||
options.output = false;
|
options.output = false;
|
||||||
options.terminal = true;
|
options.terminal = true;
|
||||||
options.detachOthers = !session.hasConnected;
|
options.detachOthers = !session.hasConnected;
|
||||||
|
options.defaultEditor = session.defaultEditor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect to backend and start tmux session
|
// Connect to backend and start tmux session
|
||||||
|
|
Ładowanie…
Reference in New Issue