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