summaryrefslogtreecommitdiffstats
path: root/keysnail
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-09-03 16:04:29 +0200
committerGravatar Tom Willemse2015-09-03 16:04:29 +0200
commit1a2a7141aee4efca47fd080a4bafa6a46e30552b (patch)
tree17ae5bf21597cac01c0726041c87cb0a1260a6a3 /keysnail
parent08b76487c66ce2f2a5818cc2607fbab95b371751 (diff)
downloaddotfiles-1a2a7141aee4efca47fd080a4bafa6a46e30552b.tar.gz
dotfiles-1a2a7141aee4efca47fd080a4bafa6a46e30552b.zip
Fix keysnail init
Diffstat (limited to 'keysnail')
-rw-r--r--keysnail/.keysnail.js32
1 files changed, 17 insertions, 15 deletions
diff --git a/keysnail/.keysnail.js b/keysnail/.keysnail.js
index 93898f6..764b39d 100644
--- a/keysnail/.keysnail.js
+++ b/keysnail/.keysnail.js
@@ -1,5 +1,5 @@
// ========================== KeySnail Init File =========================== //
-
+/*global key plugins hook command util*/
// You can preserve your code in this area when generating the init file using GUI.
// Put all your code except special key, set*key, hook, blacklist.
// ========================================================================= //
@@ -276,20 +276,22 @@ key.setEditKey('C-y', command.yank, 'Paste (Yank)', false);
key.setEditKey('M-y', command.yankPop, 'Paste pop (Yank pop)', true);
key.setEditKey('C-M-y', function (ev) {
- if (!command.kill.ring.length)
- return;
-
- let (ct = command.getClipboardText())
- (!command.kill.ring.length || ct != command.kill.ring[0]) && command.pushKillRing(ct);
-
- prompt.selector(
- {
- message: "Paste:",
- collection: command.kill.ring,
- callback: function (i) { if (i >= 0) key.insertText(command.kill.ring[i]); }
- }
- );
- }, 'Show kill-ring and select text to paste', true);
+ if (!command.kill.ring.length)
+ return;
+
+ let (ct = command.getClipboardText()) {
+ (!command.kill.ring.length || ct != command.kill.ring[0]) &&
+ command.pushKillRing(ct);
+ };
+
+ prompt.selector(
+ {
+ message: "Paste:",
+ collection: command.kill.ring,
+ callback: function (i) { if (i >= 0) key.insertText(command.kill.ring[i]); }
+ }
+ );
+}, 'Show kill-ring and select text to paste', true);
key.setEditKey('C-w', function (ev) {
goDoCommand("cmd_copy");