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 // //////////////