1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 10:18:00 +01:00

:bdelete google to close all tabs from google

This commit is contained in:
Martin Stubenschrott
2008-06-08 05:38:34 +00:00
parent 4a81ae7b11
commit 9d38f46dd3
5 changed files with 58 additions and 13 deletions

2
NEWS
View File

@@ -1,10 +1,12 @@
<pre> <pre>
2008-06-xx: 2008-06-xx:
* version 1.2 * version 1.2
* :bdelete accepts an optional argument now
* renamed some :autocmd, mainly BrowserStartup -> Startup and BrowserExit -> Quit * renamed some :autocmd, mainly BrowserStartup -> Startup and BrowserExit -> Quit
* don't pass any ctrl- or alt- prefixed keys to firefox in insert mode * don't pass any ctrl- or alt- prefixed keys to firefox in insert mode
* keywords in :open <arg> have higher priority than local files now * keywords in :open <arg> have higher priority than local files now
* add :set online to control the "work offline" menu item * add :set online to control the "work offline" menu item
* many small bug fixes
2008-06-03: 2008-06-03:
* version 1.1 * version 1.1

View File

@@ -787,6 +787,8 @@ const liberator = (function () //{{{
if (cancelQuit.data) if (cancelQuit.data)
return; return;
liberator.autocommands.trigger("Quit", "");
// notify all windows that an application quit has been granted. // notify all windows that an application quit has been granted.
os.notifyObservers(null, "quit-application-granted", null); os.notifyObservers(null, "quit-application-granted", null);
@@ -918,11 +920,12 @@ const liberator = (function () //{{{
if (option.setter && !option.hasChanged) if (option.setter && !option.hasChanged)
option.reset(); option.reset();
} }
liberator.autocommands.trigger("Startup", "");
}, 0); }, 0);
liberator.statusline.update(); liberator.statusline.update();
liberator.autocommands.trigger("Startup", "");
liberator.log(liberator.config.name + " fully initialized", 1); liberator.log(liberator.config.name + " fully initialized", 1);
}, },

View File

@@ -260,8 +260,43 @@ liberator.Tabs = function () //{{{
"Delete current buffer", "Delete current buffer",
function (args, special, count) function (args, special, count)
{ {
if (args)
{
args = args.toLowerCase();
var removed = 0;
var match;
if (match = args.match(/^(\d+):?/))
{
liberator.tabs.remove(liberator.tabs.getTab(parseInt(match[1], 10) - 1));
removed = 1;
}
else
{
var browsers = getBrowser().browsers;
for (let i = browsers.length - 1; i >= 0; i--)
{
var title = browsers[i].contentTitle.toLowerCase() || "";
var uri = browsers[i].currentURI.spec.toLowerCase();
var host = browsers[i].currentURI.host.toLowerCase();
if (host.indexOf(args) >= 0 || uri == args ||
(special && (title.indexOf(args) >= 0 || uri.indexOf(args) >= 0)))
{
liberator.tabs.remove(liberator.tabs.getTab(i));
removed++;
}
}
}
if (removed > 0)
liberator.echo(removed + " fewer tab(s)");
else
liberator.echoerr("E94: No matching tab for " + args);
}
else // just remove the current tab
liberator.tabs.remove(getBrowser().mCurrentTab, count > 0 ? count : 1, special, 0); liberator.tabs.remove(getBrowser().mCurrentTab, count > 0 ? count : 1, special, 0);
}); },
{ completer: function (filter) { return liberator.completion.buffer(filter); } });
liberator.commands.add(["tab"], liberator.commands.add(["tab"],
"Execute a command and tell it to output in a new tab", "Execute a command and tell it to output in a new tab",

View File

@@ -1,9 +1,23 @@
HEADER HEADER
|tabs| + |tabs| +
Tabs are used to be able to view many web pages at the same time... Tabs are used to be able to view many web pages at the same time...
section:Closing{nbsp}tabs[closing-tabs]
|:tabc| |:tabclose| |:bun| |:bunload| |:bw| |:bwipeout| |:bd| |:bdelete|
||:[count]bd[elete][!] [arg]|| +
________________________________________________________________________________
Delete current buffer (=tab). Count is supported, [c]:2bd[c] removes two tabs
and the one to the right is selected.
When used with [arg], remove all tabs which contain [arg] in the hostname.
[!] forces this command to also search for [arg] in the full URL and also
the title of the tab. Use with care.
________________________________________________________________________________
TO BE WRITTEN... TO BE WRITTEN...

View File

@@ -760,15 +760,6 @@ The special version [c]:back![c] goes to the beginning of the browser history.
________________________________________________________________________________ ________________________________________________________________________________
|:tabc| |:tabclose| |:bun| |:bunload| |:bw| |:bwipeout| |:bd| |:bdelete|
||:[count]bd[elete][!]|| +
________________________________________________________________________________
Delete current buffer (=tab). Count is supported, [c]:2bd[c] removes two tabs
and the one to the right is selected. Do [c]:bdelete![c] to select the tab to
the left after removing the current tab.
________________________________________________________________________________
|:beep| |:beep|
||:beep|| ||:beep||
________________________________________________________________________________ ________________________________________________________________________________