Action Directory / unIndent Code

Install

unIndents the selected text by TAB

Shared by itokon

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"));