MCPcopy
hub / github.com/ajaxorg/ace / exec

Method exec

src/commands/command_manager.js:34–56  ·  view source on GitHub ↗

* * @param {string | string[] | import("../../ace-internal").Ace.Command} command * @param {Editor} editor * @param {any} args * @returns {boolean}

(command, editor, args)

Source from the content-addressed store, hash-verified

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 *

Callers 15

replayMethod · 0.95
lookupMimeFunction · 0.80
css_worker_test.jsFile · 0.80
php.jsFile · 0.80
initCloneByTagFunction · 0.80
truncFunction · 0.80
jshint.jsFile · 0.80
cloneRegExpFunction · 0.80
lintingDirectiveFunction · 0.80

Calls 1

canExecuteMethod · 0.95

Tested by

no test coverage detected