- editor.addCommand('Indent', function() {
- if (!indentSelection()) {
- return true;
+ editor.on('BeforeExecCommand', function(e) {
+ var cmd = e.command.toLowerCase(), isHandled;
+
+ if (cmd == "indent") {
+ if (indentSelection()) {
+ isHandled = true;
+ }
+ } else if (cmd == "outdent") {
+ if (outdentSelection()) {
+ isHandled = true;
+ }