Tab now inserts two spaces, the path "coursewares/" is no longer broken

This commit is contained in:
Nathan Leniz
2015-02-06 12:36:55 -05:00
parent c22a38972b
commit f627c156fc
4 changed files with 48 additions and 25 deletions

View File

@@ -21,6 +21,15 @@ var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("codeEditor")
var editor = myCodeMirror;
editor.setSize("100%", "auto");
// Hijack tab key to enter two spaces intead
editor.setOption("extraKeys", {
Tab: function(cm) {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
cm.replaceSelection(spaces);
}
});
var attempts = 0;
if (attempts) {