mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-04 00:24:13 +01:00
fix commandline history on Windows - prevent the default cmd_charPrevious
action from being invoked for <Up
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,6 +1,7 @@
|
|||||||
<pre>
|
<pre>
|
||||||
2007-xx-xx:
|
2007-xx-xx:
|
||||||
* version 0.5.1
|
* version 0.5.1
|
||||||
|
* commandline history now works properly on Windows
|
||||||
* filename completion now works on Windows
|
* filename completion now works on Windows
|
||||||
* the Bookmarks Toolbar Folder is now read when bookmarks are first
|
* the Bookmarks Toolbar Folder is now read when bookmarks are first
|
||||||
loaded - it was skipped entirely in the past
|
loaded - it was skipped entirely in the past
|
||||||
|
|||||||
@@ -355,24 +355,32 @@ function CommandLine() //{{{
|
|||||||
/* 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 (key == "<Up>" || key == "<Down>")
|
||||||
{
|
{
|
||||||
//always reset the tab completion if we use up/down keys
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
// always reset the tab completion if we use up/down keys
|
||||||
completion_index = UNINITIALIZED;
|
completion_index = UNINITIALIZED;
|
||||||
|
|
||||||
/* save 'start' position for iterating through the history */
|
// save 'start' position for iterating through the history
|
||||||
if (history_index == UNINITIALIZED)
|
if (history_index == UNINITIALIZED)
|
||||||
{
|
{
|
||||||
history_index = history.length;
|
history_index = history.length;
|
||||||
history_start = command;
|
history_start = command;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// search the history for the first item matching the current
|
||||||
|
// commandline string
|
||||||
while (history_index >= -1 && history_index <= history.length)
|
while (history_index >= -1 && history_index <= history.length)
|
||||||
{
|
{
|
||||||
key == "<Up>" ? history_index-- : history_index++;
|
key == "<Up>" ? history_index-- : history_index++;
|
||||||
if (history_index == history.length) // user pressed DOWN when there is no newer history item
|
|
||||||
|
// user pressed DOWN when there is no newer history item
|
||||||
|
if (history_index == history.length)
|
||||||
{
|
{
|
||||||
setCommand(history_start);
|
setCommand(history_start);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cannot go past history start/end
|
// cannot go past history start/end
|
||||||
if (history_index <= -1)
|
if (history_index <= -1)
|
||||||
{
|
{
|
||||||
@@ -393,7 +401,6 @@ function CommandLine() //{{{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vimperator.beep();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* user pressed TAB to get completions of a command */
|
/* user pressed TAB to get completions of a command */
|
||||||
|
|||||||
Reference in New Issue
Block a user