From a98f9fd379a3eb0ad98c7ba57aa600abbf0a21d8 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Tue, 24 Apr 2007 19:47:35 +0000 Subject: [PATCH] 'B' works now as it is supposed to do --- chrome/content/vimperator/commands.js | 22 +++++++++++++++++++--- chrome/content/vimperator/vimperator.js | 4 ++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index bcb2e31f..faff4038 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -1481,9 +1481,25 @@ function bufshow(filter, in_comp_window) } else // in the preview window { - var items = get_buffer_completions(filter); - preview_window_fill(items); - preview_window_show(); + if(g_bufshow == true) + { + setTimeout(function () + { + var items = get_buffer_completions(filter); + preview_window_fill(items); + preview_window_show(); + g_bufshow = true; + preview_window.selectItem(preview_window.getItemAtIndex(gBrowser.mTabContainer.selectedIndex)); + }, 100); + } + else + { + var items = get_buffer_completions(filter); + preview_window_fill(items); + preview_window_show(); + g_bufshow = true; + preview_window.selectItem(preview_window.getItemAtIndex(gBrowser.mTabContainer.selectedIndex)); + } } } diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js index 96b195bb..9b809076 100644 --- a/chrome/content/vimperator/vimperator.js +++ b/chrome/content/vimperator/vimperator.js @@ -830,7 +830,7 @@ var buffer_changed_listener = else if(aFlag & Components.interfaces.nsIWebProgressListener.STATE_STOP) { //alert('stopchange'); - buffer_preview_update(); + //buffer_preview_update(); } return 0; }, @@ -838,7 +838,7 @@ var buffer_changed_listener = // This fires when the location bar changes i.e load event is confirmed // or when the user switches tabs - onLocationChange: function(aProgress, aRequest, aURI) { /*alert('locchange'); buffer_preview_update();*/ return 0; }, + onLocationChange: function(aProgress, aRequest, aURI) { /*alert('locchange');*/buffer_preview_update(); return 0; }, onProgressChange:function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress){ return 0; }, onStatusChange: function() {return 0;}, onSecurityChange: function() {return 0;},