diff --git a/AUTHORS b/AUTHORS
index bb5b012e..c61e8da0 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,6 +8,6 @@ Developers:
Patches:
* Muthu Kannan (ctrl-v support)
* Lars Kindler (:buffer(s) functionality)
- * Lee Hinman (:cd command)
+ * Lee Hinman (:cd command) -> not yet commited
* Bart Trojanowski (Makefile)
diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js
index 6af67e42..bcb2e31f 100644
--- a/chrome/content/vimperator/commands.js
+++ b/chrome/content/vimperator/commands.js
@@ -113,8 +113,8 @@ var g_commands = [/*{{{*/
[
["buffers", "files", "ls"],
["buffers"],
- "Shows a list of all buffers.",
- function (args) {bufshow("", false);},
+ "Shows a list of all buffers.
If the list is already shown, close the preview window.",
+ buffer_preview_toggle,
null
],
[
@@ -1509,13 +1509,6 @@ function buffer_preview_update(event)
bufshow("", false);
}
-// adds listeners to buffer actions.
-var container = getBrowser().tabContainer;
-container.addEventListener("TabOpen", buffer_preview_update, false);
-container.addEventListener("TabSelect", buffer_preview_update, false);
-container.addEventListener("TabMove", buffer_preview_update, false);
-container.addEventListener("TabClose", buffer_preview_update, false);
-
////////////////////////////////////////////////////////////////////////
// scrolling ////////////////////////////////////////////////////// {{{1
diff --git a/chrome/content/vimperator/completion.js b/chrome/content/vimperator/completion.js
index 2827e00e..3e92c3de 100644
--- a/chrome/content/vimperator/completion.js
+++ b/chrome/content/vimperator/completion.js
@@ -564,10 +564,11 @@ function preview_window_show()/*{{{*/
var height = get_pref("previewheight");
if (items > height)
items = height;
- if (items < 3)
+ if (items < 3) // minimum of 3 entries, drop that constraint?
items = 3;
preview_window.setAttribute("rows", items.toString());
preview_window.hidden = false;
+ g_bufshow = false;
}/*}}}*/
// vim: set fdm=marker sw=4 ts=4 et:
diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js
index 89348b98..96b195bb 100644
--- a/chrome/content/vimperator/vimperator.js
+++ b/chrome/content/vimperator/vimperator.js
@@ -144,6 +144,7 @@ nsBrowserStatusHandler.prototype =
// updating history cache is not done here but in
// the 'pageshow' event handler, because at this point I don't
// have access to the url title
+ //alert('locchange2');
},
onProgressChange:function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
{
@@ -195,30 +196,9 @@ function init()
.XULBrowserWindow = window.XULBrowserWindow;
- window.addEventListener("unload", unload, false);
- window.addEventListener("keypress", onVimperatorKeypress, true);
- // window.addEventListener("keyup", onVimperatorKeyup, true);
- // window.addEventListener("keydown", onVimperatorKeydown, true);
-
- // this handler is for middle click only in the content
- //window.addEventListener("mousedown", onVimperatorKeypress, true);
- //content.mPanelContainer.addEventListener("mousedown", onVimperatorKeypress, true);
- //document.getElementById("content").onclick = function(event) { alert("foo"); };
-
- // these 4 events require >=firefox-2.0 beta1
- window.addEventListener("TabMove", updateStatusbar, false);
- window.addEventListener("TabOpen", updateStatusbar, false);
- window.addEventListener("TabClose", updateStatusbar, false);
- //window.addEventListener("TabSelect", updateStatusbar, false);
- window.addEventListener("TabSelect", function(event)
- {
- if (hah.currentMode == HINT_MODE_ALWAYS)
- {
- hah.disableHahMode();
- hah.enableHahMode(HINT_MODE_ALWAYS);
- }
- updateStatusbar();
- }, false);
+ // this function adds all our required listeners to react on events
+ // also stuff like window.onScroll is handled there.
+ addEventListeners();
// we always start in normal mode
setCurrentMode(MODE_NORMAL);
@@ -250,31 +230,6 @@ function init()
}
- // update our history cache when a new page is shown
- // XXX: there should be a cleaner way with onload() handler, but it just
- // does not work out well for me :(
- window.document.addEventListener("pageshow", function(event)
- {
- if (!event.persisted) // only if not bypassing cache
- {
- var url = getCurrentLocation();
- var title = document.title;
- for(var i=0; i=firefox-2.0 beta1
+ window.addEventListener("TabMove", updateStatusbar, false);
+ window.addEventListener("TabOpen", updateStatusbar, false);
+ window.addEventListener("TabClose", updateStatusbar, false);
+ window.addEventListener("TabSelect", function(event)
+ {
+ if (hah.currentMode == HINT_MODE_ALWAYS)
+ {
+ hah.disableHahMode();
+ hah.enableHahMode(HINT_MODE_ALWAYS);
+ }
+ updateStatusbar();
+ }, false);
+
+ // update our history cache when a new page is shown
+ // XXX: there should be a cleaner way with onload() handler, but it just
+ // does not work out well for me :(
+ window.document.addEventListener("pageshow", function(event)
+ {
+ if (!event.persisted) // only if not bypassing cache
+ {
+ var url = getCurrentLocation();
+ var title = document.title;
+ for(var i=0; i