1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 22:58:01 +01:00

added :tablast etc. commands

This commit is contained in:
Martin Stubenschrott
2007-05-08 16:57:08 +00:00
parent cfa855ad10
commit 4a963c2441
6 changed files with 63 additions and 7 deletions

View File

@@ -10,5 +10,5 @@ Patches:
* Lars Kindler (:buffer(s) functionality)
* Lee Hinman (:open ./.. support)
* Bart Trojanowski (Makefile)
* Doug Kearns (vimperator.vim)
* Doug Kearns (vimperator.vim, :tabonly etc. commands)
</pre>

View File

@@ -1,6 +1,7 @@
<pre>
2007-05-02:
* version ???
* added :tabonly and :tabrewind and :tablast commands and some futher aliases :tabNext, etc. (by Doug Kearns)
* added vimparator.vim for .vimperatorrc syntax highlighting in the XPI (by Doug Kearns)
* Added keyword support for bookmarks to the :[tab]open commands
* many small bug fixes

4
TODO
View File

@@ -55,4 +55,8 @@ RANDOM IDEAS:
* https://addons.mozilla.org/en-US/firefox/addon/4125 - use vim to edit text fields
* Would it be possible to add a setting "maxcompletionsshown" and
"maxpreviewwindowheight" or something like this?
* 16:06:04 bartman| maxauthority: feature idea: what if :n and :N searched the
page and if they found a unique <a href=...>.*next.*</a> or <a
href=...>.*prev.*<a/> they would follow that link?
</pre>

View File

@@ -184,7 +184,14 @@ var g_commands = [/*{{{*/
["help", "h"],
["h[elp] {subject}"],
"Open the help window",
"You can jump to the specified {subject} with <code class=command>:help {subject}</code>.",
"You can jump to the specified {subject} with <code class=command>:help {subject}</code>.<br/>"+
"Make sure you use the full vim notation when jumping to {subject}. This means:<br/>"+
"<ul>"+
"<li><code class=command>:help :help</code> for commands (: prefix)</li>"+
"<li><code class=command>:help 'complete'</code> for settings (surrounded by ' and ')</li>"+
"<li><code class=command>:help o</code> for mappings (no pre- or postfix)</li>"+
"</ul>"+
"You can however use partial stings in the tab completion, so <code class=command>:help he<Tab></code> will complete <code class=command>:help :help</code>",
help,
function(filter) { return get_help_completions(filter); }
],
@@ -380,13 +387,43 @@ var g_commands = [/*{{{*/
function (filter) { return get_url_completions(filter); }
],
[
["tabprevious", "tp", "tprev", "tprevious"],
["tabp[revious]"],
["tabonly", "tabo"],
["tabo[nly]"],
"Close all other tabs",
null,
function () {
tabs = getBrowser().mTabContainer.childNodes;
for (var i = tabs.length - 1; i >= 0; i--) {
if (tabs[i] != getBrowser().mCurrentTab)
getBrowser().removeTab(tabs[i]);
}
},
null
],
[
["tabprevious", "tabp", "tp", "tprev", "tprevious", "tabNext", "tabN", "tN", "tNext"],
["tabp[revious]", "tabN[ext]"],
"Switch to the previous tab",
"Cycles to the last tab, when the first is selected.",
function(args, count) { tab_go(-1); },
null
],
[
["tabrewind", "tabr", "tabfir", "tabfirst"],
["tabr[ewind]", "tabfir[st]"],
"Switch to the first tab",
null,
function(args, count) { tab_go(1); },
null
],
[
["tablast", "tabl"],
["tabl[ast]"],
"Switch to the last tab",
null,
function(args, count) { tab_go(getBrowser().mTabContainer.childNodes.length); },
null
],
[
["undo", "u"],
["{count}undo"],

View File

@@ -355,8 +355,8 @@ function filter_url_array(urls, filter)/*{{{*/
*/
for (var i = 0; i < urls.length; i++)
{
var url = urls[i][0];
var title = urls[i][1];
var url = urls[i][0] || "";
var title = urls[i][1] || "";
if(ignorecase)
{
url = url.toLowerCase();

View File

@@ -194,10 +194,24 @@ function help(section, easter)
'\n</td></tr></table>\n</pre></body>\n</html>';
try
{
doc.open();
}
catch(e)
{
// when the url is "about:" the doc is not open
// then open a new tab for it
//if (!arguments[3] || !arguments[3].inTab)
// help(section, false, {inTab: true});
openURLsInNewTab("", true);
doc = window.content.document;
doc.open();
}
doc.write(fulldoc);
doc.close();
function cumulativeOffset(element)
{
var valueT = 0, valueL = 0;