summaryrefslogtreecommitdiff
path: root/vimperator
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-11-07 00:29:16 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-11-07 00:32:14 +0100
commit6854c8f5c088ac84009692e6f19848dea5962428 (patch)
tree272492cc95a4f12aecb4fa649d24578384ec512d /vimperator
parent0db3a5211c06d07c7e40f1527c13a67e8d560a85 (diff)
downloaddotfiles-6854c8f5c088ac84009692e6f19848dea5962428.tar.xz
vimperator: upgrade buftabs to 1.1
Diffstat (limited to 'vimperator')
-rw-r--r--vimperator/plugin/buftabs.js46
1 files changed, 25 insertions, 21 deletions
diff --git a/vimperator/plugin/buftabs.js b/vimperator/plugin/buftabs.js
index f10a616..e0a5087 100644
--- a/vimperator/plugin/buftabs.js
+++ b/vimperator/plugin/buftabs.js
@@ -3,8 +3,8 @@ let PLUGIN_INFO =
<VimperatorPlugin>
<name>Buftabs</name>
<description>Add buffer tabs to the statusline to save space.</description>
- <version>1.0</version>
- <author mail="lucas@tuple-typed.org" homepage="http://tuple-typed.org/">GGLucas</author>
+ <version>1.1</version>
+ <author mail="lucas@tuple-typed.org" homepage="http://tuple-typed.org/">Lucas de Vries (GGLucas)</author>
<license>WTFPL version 2 (http://sam.zoy.org/wtfpl/)</license>
<minVersion>2.2</minVersion>
<maxVersion>2.2</maxVersion>
@@ -15,17 +15,13 @@ let PLUGIN_INFO =
you can use the "buftabs" option to toggle it on or off.
== Styling ==
- You can style the buftabs with:
-
- :style * .buftab { <CSS> }
-
- and
-
- :style * .buftab_selected { <CSS> }
+ Use the BufTab and BufTabSelected highlight groups to style the buftabs.
+ Make sure you've called the "loadplugins" command before using the highlight
+ groups in your vimperatorrc.
== Length ==
- You can set the max length of a title before it is cut off with the buftabs_maxlength
- option. It is set to 25 by default.
+ You can set the max length of a title before it is cut off with the
+ buftabs_maxlength option. It is set to 25 by default.
]]></detail>
</VimperatorPlugin>;
@@ -129,12 +125,13 @@ buftabs = {
label.setAttribute("value", tabvalue);
+ // Set the correct highlight group
if (tabs.index() == label.tabpos)
- {
- label.className = "buftab_selected";
- } else {
- label.className = "buftab";
- }
+ label.setAttributeNS(NS.uri, "highlight", "BufTabSelected");
+ else
+ label.setAttributeNS(NS.uri, "highlight", "BufTab");
+
+
},
// Create the horizontal box for adding the tabs to
@@ -166,6 +163,7 @@ buftabs = {
}
}
+/// Attach to events in order to update the tabline
var tabContainer = tabs.getBrowser().mTabContainer;
buftabs._statusline_updateUrl = statusline.updateUrl;
@@ -191,10 +189,16 @@ tabs.getBrowser().addEventListener("load", function (event) {
statusline.updateUrl();
}, false);
+/// Initialise highlight groups
+highlight.loadCSS(String(<![CDATA[
+ BufTab
+ BufTabSelected font-weight: bold;
+]]>));
+
/// Options
-options.add(["buftabs", "buftabs"],
+options.add(["buftabs"],
"Control whether to use buftabs in the statusline",
- "boolean", 1,
+ "boolean", true,
{
setter: function (value)
{
@@ -215,14 +219,14 @@ options.add(["buftabs", "buftabs"],
completer: function (context)
[
- [0, "Don't show buftabs, show the url"],
- [1, "Show buftabs"]
+ [false, "Don't show buftabs, show the url"],
+ [true, "Show buftabs"]
],
validator: Option.validateCompleter
});
-options.add(["buftabs_maxlength", "buftabs_maxlength"],
+options.add(["buftabs_maxlength"],
"Max length of an entry in the buftabs list",
"number", "25",
{