fixed coursewares
This commit is contained in:
@ -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) {
|
||||||
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
|
if (cm.somethingSelected()){
|
||||||
cm.replaceSelection(spaces);
|
cm.indentSelection("add");
|
||||||
|
} else {
|
||||||
|
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
|
||||||
|
cm.replaceSelection(spaces);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Ctrl-Enter": function() {
|
"Ctrl-Enter": function() {
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user