From 6ca297c43118afb11f7bf4c2af18b229f7d732bf Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 17 Sep 2007 01:37:44 +0000 Subject: [PATCH] when closing the more-prompt don't pass through accept keys --- chrome/content/vimperator/ui.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/chrome/content/vimperator/ui.js b/chrome/content/vimperator/ui.js index 09c9b6dd..f5213507 100644 --- a/chrome/content/vimperator/ui.js +++ b/chrome/content/vimperator/ui.js @@ -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 "": + case "": case "": 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 "": - 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; }