Convert tabs to spaces in codemirror with the correct settings #324
This commit is contained in:
parent
e98b4176b4
commit
9c69c9acd7
@ -360,6 +360,17 @@ define([
|
|||||||
editor.setOption('indentUnit', units);
|
editor.setOption('indentUnit', units);
|
||||||
editor.setOption('tabSize', units);
|
editor.setOption('tabSize', units);
|
||||||
editor.setOption('indentWithTabs', useTabs);
|
editor.setOption('indentWithTabs', useTabs);
|
||||||
|
if (!useTabs) {
|
||||||
|
editor.setOption("extraKeys", {
|
||||||
|
Tab: function(cm) {
|
||||||
|
editor.replaceSelection(Array(units + 1).join(" "));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
editor.setOption("extraKeys", {
|
||||||
|
Tab: undefined,
|
||||||
|
});
|
||||||
|
}
|
||||||
$('.CodeMirror').css('font-size', fontSize+'px');
|
$('.CodeMirror').css('font-size', fontSize+'px');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user