From a565d2e8514845fb56164fd7f6e56147bf95500a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 6 Jun 2017 21:35:34 -0700 Subject: [PATCH] Change undo keybindings --- keysnail/.keysnail.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/keysnail/.keysnail.js b/keysnail/.keysnail.js index 8eb39c3..a43621c 100644 --- a/keysnail/.keysnail.js +++ b/keysnail/.keysnail.js @@ -118,10 +118,6 @@ key.setGlobalKey(["C-x", "K"], function (ev) { closeWindow(true); }, 'Close the window', false); -key.setGlobalKey(["C-c", "u"], function (ev) { - undoCloseTab(); - }, 'Undo closed tab', false); - key.setGlobalKey(["C-x", "n"], function (ev) { OpenBrowserWindow(); }, 'Open new window', false); @@ -502,6 +498,19 @@ key.setCaretKey('M-n', function (ev) { }, 'Focus to the previous button', false); +// In the view context, make undo about tabs. + +key.setViewKey([["C-/"], ["C-x", "u"], ["C-_"]], function (ev) { + undoCloseTab(); +}, 'Undo closed tab', false); + +// In the edit conext, make undo about text. + +key.setEditKey([["C-/"], ["C-x", "u"], ["C-_"]], function (ev) { + display.echoStatusBar("Undo!", 2000); + goDoCommand("cmd_undo"); +}, 'Undo', false); + ////////////// // HoK Keys // //////////////