mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 22:22:27 +01:00
add c_<PageUp>/<PageDown> command-line mappings
This commit is contained in:
@@ -718,10 +718,18 @@ liberator.CommandLine = function () //{{{
|
|||||||
liberator.statusline.updateProgress(""); // we may have a "match x of y" visible
|
liberator.statusline.updateProgress(""); // we may have a "match x of y" visible
|
||||||
return liberator.triggerCallback("submit", mode, command);
|
return liberator.triggerCallback("submit", mode, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
// user pressed UP or DOWN arrow to cycle history completion
|
// user pressed UP or DOWN arrow to cycle history completion
|
||||||
else if (key == "<Up>" || key == "<Down>")
|
else if (/^(<Up>|<Down>|<S-Up>|<S-Down>|<PageUp>|<PageDown>)$/.test(key))
|
||||||
{
|
{
|
||||||
|
function gotoHistoryItem(index)
|
||||||
|
{
|
||||||
|
setCommand(history.get(historyIndex));
|
||||||
|
liberator.triggerCallback("change", currentExtendedMode, liberator.commandline.getCommand());
|
||||||
|
}
|
||||||
|
|
||||||
|
let previousItem = /Up/.test(key);
|
||||||
|
let matchCurrent = !/(Page|S-)/.test(key);
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
@@ -739,7 +747,7 @@ liberator.CommandLine = function () //{{{
|
|||||||
// commandline string
|
// commandline string
|
||||||
while (historyIndex >= -1 && historyIndex <= history.length)
|
while (historyIndex >= -1 && historyIndex <= history.length)
|
||||||
{
|
{
|
||||||
key == "<Up>" ? historyIndex-- : historyIndex++;
|
previousItem ? historyIndex-- : historyIndex++;
|
||||||
|
|
||||||
// user pressed DOWN when there is no newer history item
|
// user pressed DOWN when there is no newer history item
|
||||||
if (historyIndex == history.length)
|
if (historyIndex == history.length)
|
||||||
@@ -763,15 +771,21 @@ liberator.CommandLine = function () //{{{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (history.get(historyIndex).indexOf(historyStart) == 0)
|
if (matchCurrent)
|
||||||
{
|
{
|
||||||
setCommand(history.get(historyIndex));
|
if (history.get(historyIndex).indexOf(historyStart) == 0)
|
||||||
liberator.triggerCallback("change", currentExtendedMode, this.getCommand());
|
{
|
||||||
|
gotoHistoryItem(historyIndex);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gotoHistoryItem(historyIndex);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// user pressed TAB to get completions of a command
|
// user pressed TAB to get completions of a command
|
||||||
else if (key == "<Tab>" || key == "<S-Tab>")
|
else if (key == "<Tab>" || key == "<S-Tab>")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,6 +44,22 @@ Recall the next command-line from the history list which matches the current
|
|||||||
command-line.
|
command-line.
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|
|c_<S-Up>| |c_<PageUp>|
|
||||||
|
||<S-Up>|| +
|
||||||
|
||<PageUp>||
|
||||||
|
________________________________________________________________________________
|
||||||
|
Recall the previous command-line from the history list.
|
||||||
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|
|c_<S-Down>| |c_<PageDown>|
|
||||||
|
||<S-Down>|| +
|
||||||
|
||<PageDown>||
|
||||||
|
________________________________________________________________________________
|
||||||
|
Recall the next command-line from the history list.
|
||||||
|
________________________________________________________________________________
|
||||||
|
|
||||||
section:Command-line{nbsp}completion[cmdline-completion]
|
section:Command-line{nbsp}completion[cmdline-completion]
|
||||||
|
|
||||||
|c_<Tab>| +
|
|c_<Tab>| +
|
||||||
|
|||||||
Reference in New Issue
Block a user