diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index b6156820..eec41bf1 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -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 /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////{{{ diff --git a/chrome/content/vimperator/options.js b/chrome/content/vimperator/options.js index 15a0379f..e83156e1 100644 --- a/chrome/content/vimperator/options.js +++ b/chrome/content/vimperator/options.js @@ -467,7 +467,8 @@ function Options() //{{{ "" + "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 diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js index 7db5ed11..87b369d4 100644 --- a/chrome/content/vimperator/vimperator.js +++ b/chrome/content/vimperator/vimperator.js @@ -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)