mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-08 00:35:47 +01:00
add count support to :buffer
This commit is contained in:
@@ -373,10 +373,29 @@ liberator.Tabs = function () //{{{
|
||||
|
||||
if (liberator.config.name == "Vimperator")
|
||||
{
|
||||
// TODO: add count support
|
||||
// TODO: "Zero count" if 0 specified as arg, multiple args and count ranges?
|
||||
liberator.commands.add(["b[uffer]"],
|
||||
"Switch to a buffer",
|
||||
function (args, special) { liberator.tabs.switchTo(args, special); },
|
||||
function (args, special, count)
|
||||
{
|
||||
// if a numeric arg is specified any count is ignored; if a
|
||||
// count and non-numeric arg are both specified then E488
|
||||
if (args && count > 0)
|
||||
{
|
||||
if (/^\d+$/.test(args))
|
||||
liberator.tabs.switchTo(args, special);
|
||||
else
|
||||
liberator.echoerr("E488: Trailing characters");
|
||||
}
|
||||
else if (count > 0)
|
||||
{
|
||||
liberator.tabs.switchTo(count.toString(), special);
|
||||
}
|
||||
else
|
||||
{
|
||||
liberator.tabs.switchTo(args, special);
|
||||
}
|
||||
},
|
||||
{ completer: function (filter) { return liberator.completion.buffer(filter); } });
|
||||
|
||||
liberator.commands.add(["buffers", "files", "ls", "tabs"],
|
||||
|
||||
@@ -103,10 +103,10 @@ ________________________________________________________________________________
|
||||
|
||||
|
||||
|:b| |:buffer|
|
||||
||:b[uffer][!] {url|index}|| +
|
||||
||[count]:b[uffer][!] {url|index}|| +
|
||||
________________________________________________________________________________
|
||||
Go to buffer from buffer list. Argument can be either the buffer index or the
|
||||
full URL.
|
||||
Go to the specified buffer from the buffer list. Argument can be either the
|
||||
buffer index or the full URL.
|
||||
|
||||
If argument is neither a full URL nor an index but uniquely identifies a
|
||||
buffer, it is selected. With [!] the next buffer matching the argument is
|
||||
|
||||
Reference in New Issue
Block a user