Reputation: 17762
Did the syntax for command objects change? I have been using the following:
editor.addCommand({
name: "find",
bindKey: {win: "Ctrl-F", mac: "Cmd-F"},
exec: findKeyboardHandler});
Should I write out, "Command-F" instead of "cmd-f"?
Upvotes: 0
Views: 3103
Reputation: 1614
To call addCommand, you have to call commands:
editor.commands.addCommand({
name: 'quit',
exec: function(){
yourQuitFunctionHere();
}
});
then you can use the command for keybindings or exec directly:
editor.execCommand('quit');
Upvotes: 0
Reputation: 24104
Ace command syntax had not changed for a long time
Command
, cmd
, Cmd
work the same see ace/lib/keys.js#L51-L52__proto__
, will break keyboard/hash_handler.js#L40editor
and args
object ace/commands/command_manager.js#L24Upvotes: 4