1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 16:47:59 +01:00

move the global function updateBufferList() to vimperator.tabs until we have

real buffers
This commit is contained in:
Doug Kearns
2007-07-05 06:14:32 +00:00
parent 31f06ea516
commit 54502e9929
3 changed files with 29 additions and 34 deletions

View File

@@ -350,7 +350,8 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["delm[arks]"],
function(args, special) {
function(args, special)
{
if (!special && !args)
{
vimperator.echoerr("E471: Argument required");
@@ -515,7 +516,8 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["ma[rk]"],
function(args) {
function(args)
{
if (!args) {
vimperator.echoerr("E471: Argument required");
return;
@@ -538,7 +540,8 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["marks"],
function(args) {
function(args)
{
if (args.length > 1 && !/[a-zA-Z]/.test(args))
{
vimperator.echoerr("E283: No marks matching \"" + args + "\"");
@@ -880,7 +883,8 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["qmarka[dd]", "qma[dd]"],
function(args) {
function(args)
{
var split = args.split(/\s+/);
vimperator.quickmarks.add(split[0], split[1] ? split[1] : getCurrentLocation());
},
@@ -892,9 +896,7 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["qmarkd[el]", "qmd[el]"],
function(args) {
vimperator.quickmarks.remove(args);
},
function(args) { vimperator.quickmarks.remove(args); },
{
usage: ["qmarkd[el] {a-zA-Z0-9}"],
short_help: "Remove a marked URL",
@@ -903,9 +905,7 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["qmarks", "qms"],
function(args) {
vimperator.quickmarks.list(args);
},
function(args) { vimperator.quickmarks.list(args); },
{
usage: ["qmarks"],
short_help: "Shows marked URLs",
@@ -934,9 +934,7 @@ function Commands() //{{{
}
));
addDefaultCommand(new Command(["wino[pen]", "w[open]", "wine[dit]"],
function() {
vimperator.echo("winopen not implemented yet");
},
function() { vimperator.echo("winopen not implemented yet"); },
{
usage: ["wino[pen] [url] [| url]"],
short_help: "Open an URL in a new window",
@@ -1324,21 +1322,6 @@ function yankCurrentSelection()
vimperator.echo("Yanked " + sel);
}
/////////////////////////////////////////////////////////////////////}}}
// tab/buffer related functions ////////////////////////////////////////
/////////////////////////////////////////////////////////////////////{{{
// updates the buffer preview in place only if list is visible
function updateBufferList()
{
if (!vimperator.bufferwindow.visible())
return false;
var items = get_buffer_completions("");
vimperator.bufferwindow.show(items);
vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex);
}
/////////////////////////////////////////////////////////////////////}}}
// scrolling ///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////{{{

View File

@@ -467,7 +467,8 @@ function Options() //{{{
"</table>" +
"When there is only a single match, it is fully completed regardless of the case.",
default_value: "list:full",
validator: function (value) {
validator: function (value)
{
if (/^(?:(?:full|longest|list|list:full|list:longest)(?:,(?!,))?){0,3}(?:full|longest|list|list:full|list:longest)?$/.test(value))
return true;
else

View File

@@ -363,22 +363,22 @@ function Events() //{{{
var tabcontainer = getBrowser().tabContainer;
tabcontainer.addEventListener("TabMove", function(event) {
vimperator.statusline.updateTabCount()
updateBufferList();
vimperator.tabs.updateBufferList();
}, false);
tabcontainer.addEventListener("TabOpen", function(event) {
vimperator.statusline.updateTabCount();
updateBufferList();
vimperator.tabs.updateBufferList();
vimperator.setMode(); // trick to reshow the mode in the command line
vimperator.tabs.updateSelectionHistory();
}, false);
tabcontainer.addEventListener("TabClose", function(event) {
vimperator.statusline.updateTabCount()
updateBufferList();
vimperator.tabs.updateBufferList();
vimperator.setMode(); // trick to reshow the mode in the command line
}, false);
tabcontainer.addEventListener("TabSelect", function(event) {
vimperator.statusline.updateTabCount();
updateBufferList();
vimperator.tabs.updateBufferList();
vimperator.setMode(); // trick to reshow the mode in the command line
vimperator.tabs.updateSelectionHistory();
}, false);
@@ -419,7 +419,7 @@ function Events() //{{{
}
// code which should happen for all (also background) newly loaded tabs goes here:
updateBufferList();
vimperator.tabs.updateBufferList();
//update history
var url = getCurrentLocation();
@@ -1022,6 +1022,17 @@ function Tabs() //{{{
this.alternate = this.getTab();
// updates the buffer preview in place only if list is visible
this.updateBufferList = function()
{
if (!vimperator.bufferwindow.visible())
return false;
var items = get_buffer_completions("");
vimperator.bufferwindow.show(items);
vimperator.bufferwindow.selectItem(getBrowser().mTabContainer.selectedIndex);
}
this.reload = function(tab, bypass_cache)
{
if (bypass_cache)