fix(editor): Unindent line when nothing is selected

Pressing SHIFT + TAB while no text is selected would indent the text
which is uncommon behavior. This change will always unindent the code
regardless of whether text is selected or not.
This commit is contained in:
Aaron Ang
2017-10-21 14:12:33 +02:00
parent 7bda4580fe
commit 50d1b8aae8

View File

@ -78,11 +78,7 @@ export class Editor extends PureComponent {
return cm.replaceSelection(spaces);
},
'Shift-Tab': function(cm) {
if (cm.somethingSelected()) {
return cm.indentSelection('subtract');
}
const spaces = Array(cm.getOption('indentUnit') + 1).join(' ');
return cm.replaceSelection(spaces);
return cm.indentSelection('subtract');
},
'Ctrl-Enter': function() {
executeChallenge();