unIndent Code
Shared by itokon
unIndents the selected text by TAB
Script
const text = editor.getSelectedText();
var lines = text.split("\n");
lines = lines.map(function(l) {
if (l.substr(0, 1) == "\t") {
return l.substr(1);
} else {
return l;
}
});
editor.replaceSelection(lines.join("\n"));