From f71a3c1722fa8369448da15d5e0907ab6633930b Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 4 Aug 2007 13:38:28 +0000 Subject: [PATCH] add onMultilineOutputEvent for handling more-prompt keypress events --- chrome/content/vimperator/ui.js | 15 ++++++++++++++- chrome/content/vimperator/vimperator.xul | 5 +++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/chrome/content/vimperator/ui.js b/chrome/content/vimperator/ui.js index c9cce5bb..b7d8a56a 100644 --- a/chrome/content/vimperator/ui.js +++ b/chrome/content/vimperator/ui.js @@ -146,6 +146,9 @@ function CommandLine() //{{{ multiline_output_widget.style.height = height + "px"; multiline_output_widget.collapsed = false; + setTimeout(function() { + multiline_output_widget.focus(); + }, 10); multiline_output_widget.contentWindow.scrollTo(0, content_height); // scroll to the end when 'nomore' is set } @@ -530,7 +533,7 @@ function CommandLine() //{{{ } } - this.onMultilineEvent = function(event) + this.onMultilineInputEvent = function(event) { // for now we just receive keypress events @@ -548,6 +551,16 @@ function CommandLine() //{{{ } } + this.onMultilineOutputEvent = function(event) + { + var key = event.toString(); + if (key == "" || key == "" || key == "") + { + multiline_output_widget.collapsed = true; + vimperator.focusContent(); + } + } + // it would be better if we had a destructor in javascript ... this.destroy = function() { diff --git a/chrome/content/vimperator/vimperator.xul b/chrome/content/vimperator/vimperator.xul index bf3db732..25e64f75 100644 --- a/chrome/content/vimperator/vimperator.xul +++ b/chrome/content/vimperator/vimperator.xul @@ -100,10 +100,11 @@ the terms of any one of the MPL, the GPL or the LGPL. onblur="vimperator.commandline.onEvent(event);"/> -