mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 16:57:57 +01:00
whitespace formatting fixes
This commit is contained in:
@@ -26,7 +26,7 @@ the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the MPL, the GPL or the LGPL.
|
||||
}}} ***** END LICENSE BLOCK *****/
|
||||
|
||||
vimperator.Command = function(specs, action, extra_info) //{{{
|
||||
vimperator.Command = function (specs, action, extra_info) //{{{
|
||||
{
|
||||
if (!specs || !action)
|
||||
return null;
|
||||
@@ -34,7 +34,7 @@ vimperator.Command = function(specs, action, extra_info) //{{{
|
||||
// convert command name abbreviation specs of the form
|
||||
// 'shortname[optional-tail]' to short and long versions Eg. 'abc[def]' ->
|
||||
// 'abc', 'abcdef'
|
||||
var parseSpecs = function(specs)
|
||||
var parseSpecs = function (specs)
|
||||
{
|
||||
var short_names = [];
|
||||
var long_names = [];
|
||||
@@ -89,14 +89,14 @@ vimperator.Command = function(specs, action, extra_info) //{{{
|
||||
|
||||
}
|
||||
|
||||
vimperator.Command.prototype.execute = function(args, special, count, modifiers)
|
||||
vimperator.Command.prototype.execute = function (args, special, count, modifiers)
|
||||
{
|
||||
this.action.call(this, args, special, count, modifiers);
|
||||
}
|
||||
|
||||
// return true if the candidate name matches one of the command's aliases
|
||||
// (including all acceptable abbreviations)
|
||||
vimperator.Command.prototype.hasName = function(name)
|
||||
vimperator.Command.prototype.hasName = function (name)
|
||||
{
|
||||
// match a candidate name against a command name abbreviation spec - returning
|
||||
// true if the candidate matches unambiguously
|
||||
@@ -126,7 +126,7 @@ vimperator.Command.prototype.hasName = function(name)
|
||||
}
|
||||
//}}}
|
||||
|
||||
vimperator.Commands = function() //{{{
|
||||
vimperator.Commands = function () //{{{
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
||||
@@ -138,7 +138,7 @@ vimperator.Commands = function() //{{{
|
||||
function addDefaultCommand(command)
|
||||
{
|
||||
ex_commands.push(command);
|
||||
vimperator.Commands.prototype[command.name] = function(args, special, count, modifiers)
|
||||
vimperator.Commands.prototype[command.name] = function (args, special, count, modifiers)
|
||||
{
|
||||
command.execute(args, special, count, modifiers);
|
||||
}
|
||||
@@ -156,12 +156,12 @@ vimperator.Commands = function() //{{{
|
||||
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
this.__iterator__ = function()
|
||||
this.__iterator__ = function ()
|
||||
{
|
||||
return commandsIterator();
|
||||
}
|
||||
|
||||
this.add = function(command)
|
||||
this.add = function (command)
|
||||
{
|
||||
if (!command)
|
||||
return false;
|
||||
@@ -171,7 +171,7 @@ vimperator.Commands = function() //{{{
|
||||
return true;
|
||||
}
|
||||
|
||||
this.get = function(name)
|
||||
this.get = function (name)
|
||||
{
|
||||
for (var i = 0; i < ex_commands.length; i++)
|
||||
{
|
||||
@@ -186,7 +186,7 @@ vimperator.Commands = function() //{{{
|
||||
// FIXME: doesn't really belong here...
|
||||
// return [null, null, null, null, heredoc_tag || false];
|
||||
// [count, cmd, special, args] = match;
|
||||
this.parseCommand = function(str, tag)
|
||||
this.parseCommand = function (str, tag)
|
||||
{
|
||||
// remove comments
|
||||
str.replace(/\s*".*$/, "");
|
||||
@@ -230,14 +230,14 @@ vimperator.Commands = function() //{{{
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
addDefaultCommand(new vimperator.Command(["addo[ns]"],
|
||||
function() { vimperator.open("chrome://mozapps/content/extensions/extensions.xul", vimperator.NEW_TAB); },
|
||||
function () { vimperator.open("chrome://mozapps/content/extensions/extensions.xul", vimperator.NEW_TAB); },
|
||||
{
|
||||
short_help: "Show available Browser Extensions and Themes",
|
||||
help: "You can add/remove/disable browser extensions from this dialog.<br/>Be aware that not all Firefox extensions work, because Vimperator overrides some key bindings and changes Firefox's GUI."
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["ba[ck]"],
|
||||
function(args, special, count)
|
||||
function (args, special, count)
|
||||
{
|
||||
if (special)
|
||||
vimperator.history.goToStart();
|
||||
@@ -263,7 +263,7 @@ vimperator.Commands = function() //{{{
|
||||
short_help: "Go back in the browser history",
|
||||
help: "Count is supported, <code class=\"command\">:3back</code> goes back 3 pages in the browser history.<br/>" +
|
||||
"The special version <code class=\"command\">:back!</code> goes to the beginning of the browser history.",
|
||||
completer: function(filter)
|
||||
completer: function (filter)
|
||||
{
|
||||
var sh = getWebNavigation().sessionHistory;
|
||||
var completions = [];
|
||||
@@ -280,7 +280,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["bd[elete]", "bw[ipeout]", "bun[load]", "tabc[lose]"],
|
||||
function(args, special, count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count > 0 ? count : 1, special, 0); },
|
||||
function (args, special, count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count > 0 ? count : 1, special, 0); },
|
||||
{
|
||||
usage: ["[count]bd[elete][!]"],
|
||||
short_help: "Delete current buffer (=tab)",
|
||||
@@ -289,7 +289,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["beep"],
|
||||
function() { vimperator.beep(); },
|
||||
function () { vimperator.beep(); },
|
||||
{
|
||||
short_help: "Play a system beep"
|
||||
}
|
||||
@@ -297,7 +297,7 @@ vimperator.Commands = function() //{{{
|
||||
addDefaultCommand(new vimperator.Command(["bma[rk]"],
|
||||
// takes: -t "foo" myurl
|
||||
// converts that string to a useful url and title, and calls addBookmark
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
var result = vimperator.bookmarks.parseBookmarkString(args);
|
||||
|
||||
@@ -336,7 +336,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["bmarks"],
|
||||
function(args, special) { vimperator.bookmarks.list(args, special); },
|
||||
function (args, special) { vimperator.bookmarks.list(args, special); },
|
||||
{
|
||||
usage: ["bmarks [filter]", "bmarks!"],
|
||||
short_help: "Show bookmarks",
|
||||
@@ -344,11 +344,11 @@ vimperator.Commands = function() //{{{
|
||||
"The special version <code class=\"command\">:bmarks!</code> opens the default Firefox bookmarks window.<br/>" +
|
||||
"The following options WILL be interpreted in the future:<br/>" +
|
||||
" -T comma,separated,tag,list<br/>",
|
||||
completer: function(filter) { return vimperator.completion.get_bookmark_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_bookmark_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["b[uffer]"],
|
||||
function(args, special) { vimperator.buffer.switchTo(args, special); },
|
||||
function (args, special) { vimperator.buffer.switchTo(args, special); },
|
||||
{
|
||||
usage: ["b[uffer][!] {url|index}"],
|
||||
short_help: "Go to buffer from buffer list",
|
||||
@@ -357,11 +357,11 @@ vimperator.Commands = function() //{{{
|
||||
"it is selected. With <code class=\"argument\">[!]</code> the next buffer matching the argument " +
|
||||
"is selected, even if it cannot be identified uniquely.<br/>" +
|
||||
"Use <code class=\"mapping\">b</code> as a shortcut to open this prompt.",
|
||||
completer: function(filter) { return vimperator.completion.get_buffer_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_buffer_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["buffers", "files", "ls", "tabs"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
if (args)
|
||||
{
|
||||
@@ -379,7 +379,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["delbm[arks]"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
var result = vimperator.bookmarks.parseBookmarkString(args);
|
||||
|
||||
@@ -403,11 +403,11 @@ vimperator.Commands = function() //{{{
|
||||
"The following options WILL be interpreted in the future:<br/>" +
|
||||
" [!] a special version to delete ALL bookmarks <br/>" +
|
||||
" -T comma,separated,tag,list <br/>",
|
||||
completer: function(filter) { return vimperator.completion.get_bookmark_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_bookmark_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["delm[arks]"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
if (!special && !args)
|
||||
{
|
||||
@@ -460,7 +460,7 @@ vimperator.Commands = function() //{{{
|
||||
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["delqm[arks]"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
// TODO: finish arg parsing - we really need a proper way to do this. :)
|
||||
if (!special && !args)
|
||||
@@ -489,7 +489,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["downl[oads]", "dl"],
|
||||
function() { vimperator.open("chrome://mozapps/content/downloads/downloads.xul", vimperator.NEW_TAB); },
|
||||
function () { vimperator.open("chrome://mozapps/content/downloads/downloads.xul", vimperator.NEW_TAB); },
|
||||
{
|
||||
short_help: "Show progress of current downloads",
|
||||
help: "Open the original Firefox download dialog in a new tab.<br/>" +
|
||||
@@ -525,7 +525,7 @@ vimperator.Commands = function() //{{{
|
||||
return arg;
|
||||
}
|
||||
addDefaultCommand(new vimperator.Command(["ec[ho]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
var res = argToString(args, true);
|
||||
if (res != null)
|
||||
@@ -537,11 +537,11 @@ vimperator.Commands = function() //{{{
|
||||
help: "Useful for showing informational messages. Multiple lines can be separated by \\n.<br/>" +
|
||||
"<code class=\"argument\">{expr}</code> can either be a quoted string, or any expression which can be fed to eval() like 4+5. " +
|
||||
"You can also view the source code of objects and functions if the return value of <code class=\"argument\">{expr}</code> is an object or function.",
|
||||
completer: function(filter) { return vimperator.completion.javascript(filter); }
|
||||
completer: function (filter) { return vimperator.completion.javascript(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["echoe[rr]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
var res = argToString(args, false);
|
||||
if (res != null)
|
||||
@@ -551,11 +551,11 @@ vimperator.Commands = function() //{{{
|
||||
usage: ["echoe[rr] {expr}"],
|
||||
short_help: "Display an error string at the bottom of the window",
|
||||
help: "Just like <code class=\"command\">:ec[ho]</code>, but echoes the result highlighted in red. Useful for showing important messages.",
|
||||
completer: function(filter) { return vimperator.completion.javascript(filter); }
|
||||
completer: function (filter) { return vimperator.completion.javascript(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["exe[cute]"],
|
||||
function(args) { vimperator.execute(args) },
|
||||
function (args) { vimperator.execute(args) },
|
||||
{
|
||||
usage: ["exe[cute] {expr1} [ ... ]"],
|
||||
short_help: "Execute the string that results from the evaluation of {expr1} as an Ex command.",
|
||||
@@ -563,13 +563,13 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["exu[sage]"],
|
||||
function(args, special, count, modifiers) { vimperator.help("commands", special, null, modifiers); },
|
||||
function (args, special, count, modifiers) { vimperator.help("commands", special, null, modifiers); },
|
||||
{
|
||||
short_help: "Show help for Ex commands"
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["fo[rward]", "fw"],
|
||||
function(args, special, count)
|
||||
function (args, special, count)
|
||||
{
|
||||
if (special)
|
||||
vimperator.history.goToEnd();
|
||||
@@ -595,7 +595,7 @@ vimperator.Commands = function() //{{{
|
||||
short_help: "Go forward in the browser history",
|
||||
help: "Count is supported, <code class=\"command\">:3forward</code> goes forward 3 pages in the browser history.<br/>" +
|
||||
"The special version <code class=\"command\">:forward!</code> goes to the end of the browser history.",
|
||||
completer: function(filter)
|
||||
completer: function (filter)
|
||||
{
|
||||
var sh = getWebNavigation().sessionHistory;
|
||||
var completions = [];
|
||||
@@ -612,14 +612,14 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["ha[rdcopy]"],
|
||||
function() { getBrowser().contentWindow.print(); },
|
||||
function () { getBrowser().contentWindow.print(); },
|
||||
{
|
||||
short_help: "Print current document",
|
||||
help: "Open a GUI dialog where you can select the printer, number of copies, orientation, etc."
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["h[elp]"],
|
||||
function(args, special, count, modifiers) { vimperator.help(args, special, null, modifiers); },
|
||||
function (args, special, count, modifiers) { vimperator.help(args, special, null, modifiers); },
|
||||
{
|
||||
usage: ["h[elp] {subject}"],
|
||||
short_help: "Open the help window",
|
||||
@@ -631,21 +631,21 @@ vimperator.Commands = function() //{{{
|
||||
"<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> completes <code class=\"command\">:help :help</code>.",
|
||||
completer: function(filter) { return vimperator.completion.get_help_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_help_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["hist[ory]", "hs"],
|
||||
function(args, special) { vimperator.history.list(args, special); },
|
||||
function (args, special) { vimperator.history.list(args, special); },
|
||||
{
|
||||
usage: ["hist[ory] [filter]", "history!"],
|
||||
short_help: "Show recently visited URLs",
|
||||
help: "Open the message window at the bottom of the screen with all history items which match <code class=\"argument\">[filter]</code> either in the title or URL.<br/>" +
|
||||
"The special version <code class=\"command\">:history!</code> opens the default Firefox history window.",
|
||||
completer: function(filter) { return vimperator.completion.get_history_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_history_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["javas[cript]", "js"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
if (special) // open javascript console
|
||||
vimperator.open("chrome://global/content/console.xul", vimperator.NEW_TAB);
|
||||
@@ -656,7 +656,7 @@ vimperator.Commands = function() //{{{
|
||||
if (matches && matches[2])
|
||||
{
|
||||
vimperator.commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"),
|
||||
function(code) {
|
||||
function (code) {
|
||||
try
|
||||
{
|
||||
eval(matches[1] + "\n" + code);
|
||||
@@ -690,11 +690,11 @@ vimperator.Commands = function() //{{{
|
||||
"Rudimentary <code class=\"mapping\"><Tab></code> completion is available for <code class=\"command\">:javascript {cmd}<Tab></code> (but not yet for the " +
|
||||
"<code class=\"command\">:js <<EOF</code> multiline widget). Be aware that Vimperator needs to run {cmd} through eval() " +
|
||||
"to get the completions, which could have unwanted side effects.",
|
||||
completer: function(filter) { return vimperator.completion.javascript(filter); }
|
||||
completer: function (filter) { return vimperator.completion.javascript(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["let"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
if (!args)
|
||||
{
|
||||
@@ -803,7 +803,7 @@ vimperator.Commands = function() //{{{
|
||||
if (rhs)
|
||||
{
|
||||
vimperator.mappings.add(new vimperator.Map(vimperator.modes.NORMAL, [lhs],
|
||||
function(count) { vimperator.events.feedkeys((count > 1 ? count : "") + rhs, noremap); },
|
||||
function (count) { vimperator.events.feedkeys((count > 1 ? count : "") + rhs, noremap); },
|
||||
{ flags: vimperator.Mappings.flags.COUNT, rhs: rhs }
|
||||
));
|
||||
}
|
||||
@@ -814,7 +814,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
}
|
||||
addDefaultCommand(new vimperator.Command(["map"],
|
||||
function(args) { map(args, false) },
|
||||
function (args) { map(args, false) },
|
||||
{
|
||||
usage: ["map {lhs} {rhs}", "map {lhs}", "map"],
|
||||
short_help: "Map the key sequence {lhs} to {rhs}",
|
||||
@@ -823,7 +823,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["mapc[lear]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
if (args)
|
||||
{
|
||||
@@ -840,7 +840,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["ma[rk]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
if (!args)
|
||||
{
|
||||
@@ -866,7 +866,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["marks"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
// ignore invalid mark characters unless there are no valid mark chars
|
||||
if (args && !/[a-zA-Z]/.test(args))
|
||||
@@ -885,7 +885,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["mkv[imperatorrc]"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
var filename;
|
||||
|
||||
@@ -937,7 +937,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["noh[lsearch]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
vimperator.search.clear();
|
||||
},
|
||||
@@ -948,7 +948,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["norm[al]"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
if (!args)
|
||||
{
|
||||
@@ -961,13 +961,13 @@ vimperator.Commands = function() //{{{
|
||||
{
|
||||
usage: ["norm[al][!] {commands}"],
|
||||
short_help: "Execute Normal mode commands",
|
||||
help: "Example: <code class=\"command\">:normal 20j</code> scrolls 20 lines down. " +
|
||||
help: "Example: <code class=\"command\">:normal 20j</code> scrolls 20 lines down. " +
|
||||
"If the <code class=\"argument\">[!]</code> is specified mappings will not be used."
|
||||
}
|
||||
));
|
||||
// TODO: remove duplication in :map
|
||||
addDefaultCommand(new vimperator.Command(["no[remap]"],
|
||||
function(args) { map(args, true) },
|
||||
function (args) { map(args, true) },
|
||||
{
|
||||
usage: ["no[remap] {lhs} {rhs}", "no[remap] {lhs}", "no[remap]"],
|
||||
short_help: "Map the key sequence {lhs} to {rhs}",
|
||||
@@ -975,7 +975,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["o[pen]", "e[dit]"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
if (args)
|
||||
{
|
||||
@@ -1014,7 +1014,7 @@ vimperator.Commands = function() //{{{
|
||||
"The items which are completed on <code class=\"mapping\"><Tab></code> are specified in the <code class=\"option\">'complete'</code> option.<br/>" +
|
||||
"Without argument, reloads the current page.<br/>" +
|
||||
"Without argument but with <code class=\"command\">!</code>, reloads the current page skipping the cache.",
|
||||
completer: function(filter) { return vimperator.completion.get_url_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_url_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["pa[geinfo]"],
|
||||
@@ -1025,13 +1025,13 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["pc[lose]"],
|
||||
function() { vimperator.previewwindow.hide(); },
|
||||
function () { vimperator.previewwindow.hide(); },
|
||||
{
|
||||
short_help: "Close preview window on bottom of screen"
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["pref[erences]", "prefs"],
|
||||
function(args, special, count, modifiers)
|
||||
function (args, special, count, modifiers)
|
||||
{
|
||||
if (!args)
|
||||
{
|
||||
@@ -1063,7 +1063,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["qma[rk]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
if (!args)
|
||||
{
|
||||
@@ -1087,7 +1087,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["qmarks"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
// ignore invalid mark characters unless there are no valid mark chars
|
||||
if (args && !/[a-zA-Z0-9]/.test(args))
|
||||
@@ -1106,7 +1106,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["q[uit]"],
|
||||
function() { vimperator.tabs.remove(getBrowser().mCurrentTab, 1, false, 1); },
|
||||
function () { vimperator.tabs.remove(getBrowser().mCurrentTab, 1, false, 1); },
|
||||
{
|
||||
short_help: "Quit current tab",
|
||||
help: "If this is the last tab in the window, close the window. If this was the " +
|
||||
@@ -1114,14 +1114,14 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["quita[ll]", "qa[ll]"],
|
||||
function() { vimperator.quit(false); },
|
||||
function () { vimperator.quit(false); },
|
||||
{
|
||||
short_help: "Quit Vimperator",
|
||||
help: "Quit Vimperator, no matter how many tabs/windows are open. The session is not stored."
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["re[load]"],
|
||||
function(args, special) { vimperator.tabs.reload(getBrowser().mCurrentTab, special); },
|
||||
function (args, special) { vimperator.tabs.reload(getBrowser().mCurrentTab, special); },
|
||||
{
|
||||
usage: ["re[load][!]"],
|
||||
short_help: "Reload current page",
|
||||
@@ -1129,7 +1129,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["reloada[ll]"],
|
||||
function(args, special) { vimperator.tabs.reloadAll(special); },
|
||||
function (args, special) { vimperator.tabs.reloadAll(special); },
|
||||
{
|
||||
usage: ["reloada[ll][!]"],
|
||||
short_help: "Reload all pages",
|
||||
@@ -1137,14 +1137,14 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["res[tart]"],
|
||||
function() { vimperator.restart(); },
|
||||
function () { vimperator.restart(); },
|
||||
{
|
||||
short_help: "Force the browser to restart",
|
||||
help: "Useful when installing extensions."
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["sav[eas]", "w[rite]"],
|
||||
function() { saveDocument(window.content.document); },
|
||||
function () { saveDocument(window.content.document); },
|
||||
{
|
||||
short_help: "Save current web page to disk",
|
||||
help: "Opens the original Firefox \"Save page as...\" dialog.<br/>" +
|
||||
@@ -1153,7 +1153,7 @@ vimperator.Commands = function() //{{{
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["se[t]"],
|
||||
// TODO: support setting multiple options at once
|
||||
function(args, special, count, modifiers)
|
||||
function (args, special, count, modifiers)
|
||||
{
|
||||
if (special)
|
||||
{
|
||||
@@ -1362,12 +1362,12 @@ vimperator.Commands = function() //{{{
|
||||
"<code class=\"command\">:set option+={value}</code>, <code class=\"command\">:set option^={value}</code> and <code class=\"command\">:set option-={value}</code> " +
|
||||
"adds/multiplies/subtracts <code class=\"argument\">{value}</code> from a number option and appends/prepends/removes <code class=\"argument\">{value}</code> from a string option.<br/>" +
|
||||
"<code class=\"command\">:set all</code> shows the current value of all options and <code class=\"command\">:set all&</code> resets all options to their default values.<br/>",
|
||||
completer: function(filter) { return vimperator.completion.get_options_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_options_completions(filter); }
|
||||
}
|
||||
));
|
||||
// TODO: sclose instead?
|
||||
addDefaultCommand(new vimperator.Command(["sbcl[ose]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
if (args)
|
||||
{
|
||||
@@ -1385,7 +1385,7 @@ vimperator.Commands = function() //{{{
|
||||
// TODO: sopen instead? Separate :sidebar from :sbopen and make them behave
|
||||
// more like :cw, :cope etc
|
||||
addDefaultCommand(new vimperator.Command(["sideb[ar]", "sb[ar]", "sbope[n]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
if (!args)
|
||||
{
|
||||
@@ -1413,11 +1413,11 @@ vimperator.Commands = function() //{{{
|
||||
short_help: "Open the sidebar window",
|
||||
help: "<code class=\"argument\">{name}</code> is any of the menu items listed under the standard Firefox View->Sidebar " +
|
||||
"menu. Add-ons, Preferences and Downloads are also available in the sidebar.",
|
||||
completer: function(filter) { return vimperator.completion.get_sidebar_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_sidebar_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["so[urce]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
// FIXME: implement proper filename quoting
|
||||
//if (/[^\\]\s/.test(args))
|
||||
@@ -1433,14 +1433,14 @@ vimperator.Commands = function() //{{{
|
||||
short_help: "Read Ex commands from {file}",
|
||||
help: "You can either source files which mostly contain Ex commands like <code class=\"command\">map < gt</code> " +
|
||||
"and put JavaScript code within a:<br/><code class=\"code\">" +
|
||||
"js <<EOF<br/>hello = function() {<br/> alert(\"Hello world\");<br/>}<br/>EOF<br/></code> section.<br/>" +
|
||||
"js <<EOF<br/>hello = function () {<br/> alert(\"Hello world\");<br/>}<br/>EOF<br/></code> section.<br/>" +
|
||||
"Or you can alternatively source a file which ends in .js, these files are automatically sourced as pure JavaScript files.<br/>" +
|
||||
"NOTE: In both cases you must add functions to the global window object like shown above, functions written as:<br/>" +
|
||||
"<code class=\"code\">function hello2() {<br/> alert(\"Hello world\");<br/>}<br/></code>are only available within the scope of the script. <br/><br/>" +
|
||||
"The .vimperatorrc file in your home directory and any files in ~/.vimperator/plugin/ are always sourced at startup.<br/>" +
|
||||
"~ is supported as a shortcut for the <var>$HOME</var> directory.<br/>" +
|
||||
"If <code class=\"command\">!</code> is specified, errors are not printed.",
|
||||
completer: function(filter) { return vimperator.completion.get_file_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_file_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["st[op]"],
|
||||
@@ -1451,24 +1451,24 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["tab"],
|
||||
function(args) { vimperator.execute(args, { inTab: true }); },
|
||||
function (args) { vimperator.execute(args, { inTab: true }); },
|
||||
{
|
||||
usage: ["tab {cmd}"],
|
||||
short_help: "Execute {cmd} and tell it to output in a new tab",
|
||||
help: "Works only for commands that support it, currently:" +
|
||||
"<ul><li>:tab help</li>" +
|
||||
"<li>:tab prefs[!]</li></ul>",
|
||||
completer: function(filter) { return vimperator.completion.get_command_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_command_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["tabl[ast]"],
|
||||
function() { vimperator.tabs.select("$", false); },
|
||||
function () { vimperator.tabs.select("$", false); },
|
||||
{
|
||||
short_help: "Switch to the last tab"
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["tabm[ove]"],
|
||||
function(args, special) { vimperator.tabs.move(getBrowser().mCurrentTab, args, special); },
|
||||
function (args, special) { vimperator.tabs.move(getBrowser().mCurrentTab, args, special); },
|
||||
{
|
||||
usage: ["tabm[ove] [N]", "tabm[ove][!] +N | -N"],
|
||||
short_help: "Move the current tab after tab N",
|
||||
@@ -1478,7 +1478,7 @@ vimperator.Commands = function() //{{{
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["tabn[ext]", "tn[ext]"],
|
||||
// TODO: count support
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
if (!args)
|
||||
{
|
||||
@@ -1504,13 +1504,13 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["tabo[nly]"],
|
||||
function() { vimperator.tabs.keepOnly(getBrowser().mCurrentTab); },
|
||||
function () { vimperator.tabs.keepOnly(getBrowser().mCurrentTab); },
|
||||
{
|
||||
short_help: "Close all other tabs"
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["tabopen", "t[open]", "tabnew", "tabe[dit]"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
var where = special ? vimperator.NEW_TAB : vimperator.NEW_BACKGROUND_TAB;
|
||||
if (/\btabopen\b/.test(vimperator.options["activate"]))
|
||||
@@ -1526,12 +1526,12 @@ vimperator.Commands = function() //{{{
|
||||
short_help: "Open one or more URLs in a new tab",
|
||||
help: "Like <code class=\"command\">:open</code> but open URLs in a new tab.<br/>" +
|
||||
"If used with <code class=\"command\">!</code>, the 'tabopen' value of the <code class=\"option\">'activate'</code> option is negated.",
|
||||
completer: function(filter) { return vimperator.completion.get_url_completions(filter); }
|
||||
completer: function (filter) { return vimperator.completion.get_url_completions(filter); }
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["tabp[revious]", "tp[revious]", "tabN[ext]", "tN[ext]"],
|
||||
// TODO: count support
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
if (!args)
|
||||
vimperator.tabs.select("-1", true);
|
||||
@@ -1547,14 +1547,14 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["tabr[ewind]", "tabfir[st]"],
|
||||
function() { vimperator.tabs.select(0, false); },
|
||||
function () { vimperator.tabs.select(0, false); },
|
||||
{
|
||||
usage: ["tabr[ewind]", "tabfir[st]"],
|
||||
short_help: "Switch to the first tab"
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["time"],
|
||||
function(args, special, count)
|
||||
function (args, special, count)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1645,7 +1645,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["u[ndo]"],
|
||||
function(args, special, count)
|
||||
function (args, special, count)
|
||||
{
|
||||
if (count < 1)
|
||||
count = 1;
|
||||
@@ -1670,7 +1670,7 @@ vimperator.Commands = function() //{{{
|
||||
short_help: "Undo closing of a tab",
|
||||
help: "If a count is given, don't close the last but the <code class=\"argument\">[count]</code>th last tab. " +
|
||||
"With <code class=\"argument\">[url]</code> restores the tab matching the url.",
|
||||
completer: function(filter)
|
||||
completer: function (filter)
|
||||
{
|
||||
// get closed-tabs from nsSessionStore
|
||||
var ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
@@ -1689,7 +1689,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["undoa[ll]"],
|
||||
function(args, special, count)
|
||||
function (args, special, count)
|
||||
{
|
||||
if (count > -1)
|
||||
{
|
||||
@@ -1713,7 +1713,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["unl[et]"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
if (!args)
|
||||
return vimperator.echoerr("E471: Argument required");
|
||||
@@ -1742,7 +1742,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["unm[ap]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
if (!args)
|
||||
{
|
||||
@@ -1764,7 +1764,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["ve[rsion]"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
if (special)
|
||||
vimperator.open("about:");
|
||||
@@ -1779,13 +1779,13 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["viu[sage]"],
|
||||
function(args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); },
|
||||
function (args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); },
|
||||
{
|
||||
short_help: "Show help for normal mode commands"
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["winc[lose]", "wc[lose]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
window.close();
|
||||
},
|
||||
@@ -1795,7 +1795,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["wino[pen]", "wo[pen]", "wine[dit]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
if (args)
|
||||
vimperator.open(args, vimperator.NEW_WINDOW);
|
||||
@@ -1809,7 +1809,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["wqa[ll]", "wq", "xa[ll]"],
|
||||
function() { vimperator.quit(true); },
|
||||
function () { vimperator.quit(true); },
|
||||
{
|
||||
usage: ["wqa[ll]", "xa[ll]"],
|
||||
short_help: "Save the session and quit",
|
||||
@@ -1818,7 +1818,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["zo[om]"],
|
||||
function(args)
|
||||
function (args)
|
||||
{
|
||||
var level;
|
||||
|
||||
@@ -1863,7 +1863,7 @@ vimperator.Commands = function() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new vimperator.Command(["!", "run"],
|
||||
function(args, special)
|
||||
function (args, special)
|
||||
{
|
||||
// :!! needs to be treated specially as the command parser sets the special flag but removes the ! from args
|
||||
if (special)
|
||||
|
||||
Reference in New Issue
Block a user