1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-30 09:12:26 +01:00

add count support to :buffer

This commit is contained in:
Doug Kearns
2008-08-14 04:03:21 +00:00
parent e480e466dc
commit be5c793f4f
2 changed files with 24 additions and 5 deletions

View File

@@ -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"],