Fix keysnail init

This commit is contained in:
Tom Willemse 2015-09-03 16:04:29 +02:00
parent 08b76487c6
commit 1a2a7141ae

View file

@ -1,5 +1,5 @@
// ========================== KeySnail Init File =========================== // // ========================== KeySnail Init File =========================== //
/*global key plugins hook command util*/
// You can preserve your code in this area when generating the init file using GUI. // 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. // 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('M-y', command.yankPop, 'Paste pop (Yank pop)', true);
key.setEditKey('C-M-y', function (ev) { key.setEditKey('C-M-y', function (ev) {
if (!command.kill.ring.length) if (!command.kill.ring.length)
return; return;
let (ct = command.getClipboardText()) let (ct = command.getClipboardText()) {
(!command.kill.ring.length || ct != command.kill.ring[0]) && command.pushKillRing(ct); (!command.kill.ring.length || ct != command.kill.ring[0]) &&
command.pushKillRing(ct);
};
prompt.selector( prompt.selector(
{ {
message: "Paste:", message: "Paste:",
collection: command.kill.ring, collection: command.kill.ring,
callback: function (i) { if (i >= 0) key.insertText(command.kill.ring[i]); } callback: function (i) { if (i >= 0) key.insertText(command.kill.ring[i]); }
} }
); );
}, 'Show kill-ring and select text to paste', true); }, 'Show kill-ring and select text to paste', true);
key.setEditKey('C-w', function (ev) { key.setEditKey('C-w', function (ev) {
goDoCommand("cmd_copy"); goDoCommand("cmd_copy");