1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 02:28:00 +01:00

Add c_<C-p> and c_<C-n> as aliases for c_<S-Up>/c_<S-Down>.

This commit is contained in:
Doug Kearns
2010-12-04 08:38:02 +11:00
parent f94e864ded
commit 3886a82f47
3 changed files with 13 additions and 5 deletions

View File

@@ -837,13 +837,13 @@ const CommandLine = Module("commandline", {
commandline.triggerCallback("submit", mode, command);
}
// user pressed <Up> or <Down> arrow to cycle history completion
else if (/^<(Up|Down|S-Up|S-Down|PageUp|PageDown)>$/.test(key)) {
else if (/^<(Up|Down|S-Up|S-Down)>$/.test(key)) {
// prevent tab from moving to the next field
event.preventDefault();
event.stopPropagation();
dactyl.assert(this._history);
this._history.select(/Up/.test(key), !/(Page|S-)/.test(key));
this._history.select(/Up/.test(key), !/S-/.test(key));
}
// user pressed <Tab> to get completions of a command
else if (/^<(?:A-)?(?:S-)?Tab>$/.test(key)) {
@@ -1686,6 +1686,14 @@ const CommandLine = Module("commandline", {
dactyl.assert(commandline._lastMowOutput, "No previous command output");
commandline._echoMultiline(commandline._lastMowOutput, commandline.HL_NORMAL);
});
mappings.add(myModes,
["<C-p>", "<PageUp>"], "Recall the previous command line from the history list",
function () { events.feedkeys("<S-Up>"); });
mappings.add(myModes,
["<C-n>", "<PageDown>"], "Recall the next command line from the history list",
function () { events.feedkeys("<S-Down>"); });
},
options: function () {
options.add(["history", "hi"],