This commit is contained in:
Fabian Jakobs 2011-12-14 16:50:04 +01:00
commit 95537b4f4f

View file

@ -56,7 +56,7 @@ module.exports = {
},
called: false,
exec: function(editor) { this.called = true; }
}
};
this.cm = new CommandManager("mac", [this.command]);
},
@ -113,7 +113,7 @@ module.exports = {
},
called: false,
exec: function(editor) { this.called = true; }
}
};
this.cm.addCommand(command);
this.cm.exec("gotoline");
@ -127,16 +127,16 @@ module.exports = {
var called = "";
this.cm.addCommands({
togglerecording: function(editor) {
editor.cm.toggleRecording()
editor.cm.toggleRecording();
},
replay: function(editor) {
editor.cm.replay()
editor.cm.replay();
},
cm1: function(editor, arg) {
called += "1" + (arg || "")
called += "1" + (arg || "");
},
cm2: function(editor) {
called += "2"
called += "2";
}
});
@ -158,17 +158,17 @@ module.exports = {
var called = "";
this.cm.addCommands({
cm1: function(editor, arg) {
called += "1" + (arg || "")
called += "1" + (arg || "");
},
cm2: function(editor) {
called += "2"
called += "2";
}
});
this.cm.bindKeys({
"Ctrl-L|Command-C": "cm1",
"Ctrl-R": "cm2",
})
"Ctrl-R": "cm2"
});
var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "C");
assert.equal(command, "cm1");
@ -178,7 +178,7 @@ module.exports = {
this.cm.bindKeys({
"Ctrl-R": null
})
});
var command = this.cm.findKeyCommand(keys.KEY_MODS.ctrl, "R");
assert.equal(command, null);
@ -188,5 +188,5 @@ module.exports = {
});
if (typeof module !== "undefined" && module === require.main) {
require("asyncjs").test.testcase(module.exports).exec()
require("asyncjs").test.testcase(module.exports).exec();
}