diff --git a/chrome/content/vimperator/buffers.js b/chrome/content/vimperator/buffers.js index c6066d8a..0c37cfb6 100644 --- a/chrome/content/vimperator/buffers.js +++ b/chrome/content/vimperator/buffers.js @@ -138,6 +138,50 @@ function Buffer() //{{{ return window.content.document.title; }); + // TODO: move to v.buffers.list() + this.list = function(fullmode) + { + if (fullmode) + { + // toggle the special buffer previw window + if (vimperator.bufferwindow.visible()) + { + vimperator.bufferwindow.hide(); + } + else + { + var items = vimperator.completion.get_buffer_completions(""); + vimperator.bufferwindow.show(items); + vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex); + } + } + else + { + // TODO: move this to vimperator.buffers.get() + var items = vimperator.completion.get_buffer_completions(""); + var number, indicator, title, url; + + var list = "
| " + number + " | " + indicator + " | " + title + " | " + url + " |
:buffers! opens the buffer list in a persistent preview window. " +
+ "Call the special version of this command again to close the window."
}
));
addDefaultCommand(new Command(["delbm[arks]"],
@@ -561,10 +552,7 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["hist[ory]", "hs"],
- function(args, special)
- {
- vimperator.history.list(args, special);
- },
+ function(args, special) { vimperator.history.list(args, special); },
{
usage: ["hist[ory] [filter]", "history!"],
short_help: "Show recently visited URLs",
diff --git a/chrome/content/vimperator/mappings.js b/chrome/content/vimperator/mappings.js
index e221c104..74c4853b 100644
--- a/chrome/content/vimperator/mappings.js
+++ b/chrome/content/vimperator/mappings.js
@@ -328,7 +328,7 @@ function Mappings() //{{{
}
));
addDefaultMap(new Map(vimperator.modes.NORMAL, ["B"],
- function() { vimperator.commands.buffers(); },
+ function() { vimperator.buffer.list(true); },
{
short_help: "Toggle buffer list",
help: "Toggles the display of the buffer list which shows all opened tabs."
diff --git a/chrome/content/vimperator/tabs.js b/chrome/content/vimperator/tabs.js
index 9bdd9abf..cefb81e4 100644
--- a/chrome/content/vimperator/tabs.js
+++ b/chrome/content/vimperator/tabs.js
@@ -188,6 +188,7 @@ function Tabs() //{{{
this.alternate = alternates[1];
}
+ // TODO: move to v.buffers
this.alternate = this.getTab();
this.reload = function(tab, bypass_cache)