Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
fix keybinding in a slightly less kludgy way
Browse files Browse the repository at this point in the history
  • Loading branch information
joewalker committed Apr 6, 2011
1 parent 2ddec87 commit b6e3f52
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 184 deletions.
28 changes: 3 additions & 25 deletions demo/demo.js
Expand Up @@ -397,8 +397,7 @@ exports.launch = function(env) {
name: "focuscli",
bindKey: {
win: "Ctrl-J",
mac: "Command-J",
sender: "editor"
mac: "Command-J"
},
exec: function() {
env.cli.cliView.element.focus();
Expand All @@ -410,8 +409,7 @@ exports.launch = function(env) {
name: "focuseditor",
bindKey: {
win: "Ctrl-J",
mac: "Command-J",
sender: "cli"
mac: "Command-J"
},
exec: function() {
env.editor.focus();
Expand All @@ -423,32 +421,12 @@ exports.launch = function(env) {
name: "save",
bindKey: {
win: "Ctrl-S",
mac: "Command-S",
sender: "editor|cli"
mac: "Command-S"
},
exec: function() {
alert("Fake Save File");
}
});

// Fake-Print with custom lookup-sender-match function.
canon.addCommand({
name: "save",
bindKey: {
win: "Ctrl-P",
mac: "Command-P",
sender: function(env, sender, hashId, keyString) {
if (sender == "editor") {
return true;
} else {
alert("Sorry, can only print from the editor");
}
}
},
exec: function() {
alert("Fake Print File");
}
});
};

});

0 comments on commit b6e3f52

Please sign in to comment.