insert spaces on <Tab> when editor.indentWithTabs is false
This commit is contained in:
parent
923f55d532
commit
05dbcff7c3
|
@ -19,6 +19,9 @@ onDOMscriptReady('/codemirror.js').then(() => {
|
|||
nextEditor, prevEditor,
|
||||
commentSelection,
|
||||
};
|
||||
const ORIGINAL_COMMANDS = {
|
||||
insertTab: CodeMirror.commands.insertTab,
|
||||
};
|
||||
// reroute handling to nearest editor when keypress resolves to one of these commands
|
||||
const REROUTED = new Set([
|
||||
'save',
|
||||
|
@ -244,6 +247,12 @@ onDOMscriptReady('/codemirror.js').then(() => {
|
|||
CodeMirror.setOption('indentUnit', value);
|
||||
break;
|
||||
|
||||
case 'indentWithTabs':
|
||||
CodeMirror.commands.insertTab = value ?
|
||||
ORIGINAL_COMMANDS.insertTab :
|
||||
CodeMirror.commands.insertSoftTab;
|
||||
break;
|
||||
|
||||
case 'theme': {
|
||||
const themeLink = $('#cm-theme');
|
||||
// use non-localized 'default' internally
|
||||
|
|
Loading…
Reference in New Issue
Block a user