1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 00:24:13 +01:00

when closing the more-prompt don't pass through accept keys

This commit is contained in:
Doug Kearns
2007-09-17 01:37:44 +00:00
parent 7ce12b3a87
commit 6ca297c431

View File

@@ -616,11 +616,16 @@ function CommandLine() //{{{
function atEnd() { return win.scrollY / win.scrollMaxY >= 1; }
function pass(event)
function close()
{
multiline_output_widget.collapsed = true;
// FIXME: use mode stack
vimperator.modes.reset();
}
function pass(event)
{
close();
vimperator.events.onKeyPress(event);
}
@@ -645,11 +650,13 @@ function CommandLine() //{{{
pass(event);
break;
case "<C-j>":
case "<C-m>":
case "<Return>":
if (vimperator.options["more"] && isScrollable() && !atEnd())
win.scrollByLines(1);
else
pass(event);
close(); // don't propagate the event for accept keys
break;
// up a line
@@ -673,10 +680,10 @@ function CommandLine() //{{{
break;
case "<LeftMouse>":
if (!/^(end|more(-help)?)-prompt$/.test(event.target.id))
break;
else
if (/^(end|more(-help)?)-prompt$/.test(event.target.id))
; // fall through
else
break;
// page down
case "f":
@@ -745,15 +752,13 @@ function CommandLine() //{{{
// close the window
case "q":
this.clear();
close();
break;
// invalid key
// unmapped key
default:
if (!vimperator.options["more"] || !isScrollable() || atEnd() || vimperator.events.isCancelKey(key))
pass(event);
else if (atEnd() && vimperator.events.isAcceptKey(key))
pass(event);
else
show_more_help_prompt = true;
}