fixed coursewares

This commit is contained in:
Renter
2015-03-14 17:02:36 -04:00
committed by MrRenter
parent 7a765fdca2
commit b7dd72f3a3

View File

@ -22,8 +22,12 @@ var editor = myCodeMirror;
// Hijack tab key to insert two spaces instead // Hijack tab key to insert two spaces instead
editor.setOption("extraKeys", { editor.setOption("extraKeys", {
Tab: function(cm) { Tab: function(cm) {
if (cm.somethingSelected()){
cm.indentSelection("add");
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
cm.replaceSelection(spaces); cm.replaceSelection(spaces);
}
}, },
"Ctrl-Enter": function() { "Ctrl-Enter": function() {
return false; return false;