god dammit already

This commit is contained in:
MrRenter
2015-03-17 03:07:07 -04:00
parent c9970c1725
commit 6a2209b9b4

View File

@ -22,12 +22,8 @@ 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()){ var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
cm.indentSelection("add"); cm.replaceSelection(spaces);
} else {
var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
cm.replaceSelection(spaces);
}
}, },
"Ctrl-Enter": function() { "Ctrl-Enter": function() {
return false; return false;