* * @param {string | string[] | import("../../ace-internal").Ace.Command} command * @param {Editor} editor * @param {any} args * @returns {boolean}
(command, editor, args)
| 32 | * @returns {boolean} |
| 33 | */ |
| 34 | exec(command, editor, args) { |
| 35 | if (Array.isArray(command)) { |
| 36 | for (var i = command.length; i--; ) { |
| 37 | if (this.exec(command[i], editor, args)) return true; |
| 38 | } |
| 39 | return false; |
| 40 | } |
| 41 | |
| 42 | if (typeof command === "string") |
| 43 | command = this.commands[command]; |
| 44 | |
| 45 | var e = {editor: editor, command: command, args: args}; |
| 46 | |
| 47 | if (!this.canExecute(command, editor)) { |
| 48 | this._signal("commandUnavailable", e); |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | e.returnValue = this._emit("exec", e); |
| 53 | this._signal("afterExec", e); |
| 54 | |
| 55 | return e.returnValue === false ? false : true; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * |
no test coverage detected