resolve conflict

This commit is contained in:
Nathan Leniz
2015-03-15 17:08:34 +09:00
4 changed files with 45 additions and 8 deletions

View File

@@ -17,9 +17,21 @@ editor.setSize("100%", "auto");
// Hijack tab key to enter two spaces intead
editor.setOption("extraKeys", {
Tab: function(mc) {
var spaces = Array(mc.getOption("indentUnit") + 1).join(" ");
mc.replaceSelection(spaces);
Tab: function(cm) {
if (cm.somethingSelected()){
cm.indentSelection("add");
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
cm.replaceSelection(spaces);
}
},
"Shift-Tab": function(cm) {
if (cm.somethingSelected()){
cm.indentSelection("subtract");
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
cm.replaceSelection(spaces);
}
},