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

add some missing semicolons

This commit is contained in:
Doug Kearns
2007-10-31 09:02:03 +00:00
parent a5202d1b9b
commit 95d0487677

View File

@@ -114,11 +114,15 @@ vimperator.Command.prototype.hasName = function(name)
for (var i = 0; i < this.specs.length; i++) for (var i = 0; i < this.specs.length; i++)
{ {
if (this.specs[i] == name) // literal command name if (this.specs[i] == name) // literal command name
{
return true; return true;
}
else if (this.specs[i].match(/^(\w+|!)\[\w+\]$/)) // abbreviation spec else if (this.specs[i].match(/^(\w+|!)\[\w+\]$/)) // abbreviation spec
{
if (matchAbbreviation(name, this.specs[i])) if (matchAbbreviation(name, this.specs[i]))
return true; return true;
} }
}
return false; return false;
} }
//}}} //}}}
@@ -421,7 +425,7 @@ vimperator.Commands = function() //{{{
i += count; // hopefully count is always >0, otherwise we get an endless loop i += count; // hopefully count is always >0, otherwise we get an endless loop
} }
return { opts: opts, args: args } return { opts: opts, args: args };
} }
function getOption(opts, option, def) function getOption(opts, option, def)
@@ -721,7 +725,7 @@ vimperator.Commands = function() //{{{
if (special && args) if (special && args)
{ {
vimperator.echoerr("E474: Invalid argument"); vimperator.echoerr("E474: Invalid argument");
return return;
} }
var matches; var matches;
if (matches = args.match(/(?:(?:^|[^a-zA-Z0-9])-|-(?:$|[^a-zA-Z0-9])|[^a-zA-Z0-9 -]).*/)) if (matches = args.match(/(?:(?:^|[^a-zA-Z0-9])-|-(?:$|[^a-zA-Z0-9])|[^a-zA-Z0-9 -]).*/))
@@ -775,7 +779,7 @@ vimperator.Commands = function() //{{{
if (special && args) if (special && args)
{ {
vimperator.echoerr("E474: Invalid argument"); vimperator.echoerr("E474: Invalid argument");
return return;
} }
if (special) if (special)
@@ -1106,7 +1110,7 @@ vimperator.Commands = function() //{{{
return; return;
} }
var matches = args.match(/^([^\s]+)(?:\s+(.+))?$/) var matches = args.match(/^([^\s]+)(?:\s+(.+))?$/);
var [lhs, rhs] = [matches[1], matches[2]]; var [lhs, rhs] = [matches[1], matches[2]];
var leader_reg = /<Leader>/i; var leader_reg = /<Leader>/i;
@@ -1192,7 +1196,7 @@ vimperator.Commands = function() //{{{
} }
var filter = args.replace(/[^a-zA-Z]/g, ''); var filter = args.replace(/[^a-zA-Z]/g, '');
vimperator.marks.list(filter) vimperator.marks.list(filter);
}, },
{ {
usage: ["marks [arg]"], usage: ["marks [arg]"],
@@ -1215,7 +1219,7 @@ vimperator.Commands = function() //{{{
if (file.exists() && !special) if (file.exists() && !special)
{ {
vimperator.echoerr("E189: \".vimperatorrc\" exists (add ! to override)"); vimperator.echoerr("E189: \".vimperatorrc\" exists (add ! to override)");
return return;
} }
var line = "\" " + vimperator.version + "\n"; var line = "\" " + vimperator.version + "\n";
@@ -1537,7 +1541,7 @@ vimperator.Commands = function() //{{{
var only_non_default = false; //used for :set to print non-default options var only_non_default = false; //used for :set to print non-default options
if (!args) if (!args)
{ {
args = "all?" args = "all?";
only_non_default = true; only_non_default = true;
} }
@@ -1723,13 +1727,13 @@ vimperator.Commands = function() //{{{
return; return;
} }
var menu = document.getElementById("viewSidebarMenu") var menu = document.getElementById("viewSidebarMenu");
for (var i = 0; i < menu.childNodes.length; i++) for (var i = 0; i < menu.childNodes.length; i++)
{ {
if (menu.childNodes[i].label == args) if (menu.childNodes[i].label == args)
{ {
eval(menu.childNodes[i].getAttribute('oncommand')) eval(menu.childNodes[i].getAttribute('oncommand'));
break; break;
} }
} }
@@ -1890,11 +1894,15 @@ vimperator.Commands = function() //{{{
var before_time = Date.now(); var before_time = Date.now();
if (args && args[0] == ":") if (args && args[0] == ":")
{
while (i--) while (i--)
vimperator.execute(args); vimperator.execute(args);
}
else else
{
while (i--) while (i--)
eval(args); eval(args);
}
if (special) if (special)
return; return;
@@ -2033,7 +2041,7 @@ vimperator.Commands = function() //{{{
short_help: "Undo closing of all closed tabs", short_help: "Undo closing of all closed tabs",
help: "Firefox stores up to 10 closed tabs, even after a browser restart." help: "Firefox stores up to 10 closed tabs, even after a browser restart."
} }
)), ));
addDefaultCommand(new vimperator.Command(["unl[et]"], addDefaultCommand(new vimperator.Command(["unl[et]"],
function(args, special) function(args, special)
{ {
@@ -2113,7 +2121,7 @@ vimperator.Commands = function() //{{{
}, },
{ {
usage: ["winc[ose] [url] [, url]"], usage: ["winc[ose] [url] [, url]"],
short_help: "Close window", short_help: "Close window"
} }
)); ));
addDefaultCommand(new vimperator.Command(["wino[pen]", "wo[pen]", "wine[dit]"], addDefaultCommand(new vimperator.Command(["wino[pen]", "wo[pen]", "wine[dit]"],
@@ -2195,7 +2203,7 @@ vimperator.Commands = function() //{{{
args = args.replace(/(^|[^\\])!/g, "$1" + last_run_command); args = args.replace(/(^|[^\\])!/g, "$1" + last_run_command);
last_run_command = args; last_run_command = args;
var output = vimperator.system(args) var output = vimperator.system(args);
if (output) if (output)
vimperator.echo(vimperator.util.escapeHTML(output)); vimperator.echo(vimperator.util.escapeHTML(output));
}, },
@@ -2243,7 +2251,7 @@ String.prototype.toURLArray = function() // {{{
{ {
var location = window.content.document.location; var location = window.content.document.location;
var tail = matches[1] ? matches[1] : ""; var tail = matches[1] ? matches[1] : "";
urls[url] = location.protocol + "//" + location.host + "/" + tail urls[url] = location.protocol + "//" + location.host + "/" + tail;
continue; continue;
} }
@@ -2252,7 +2260,7 @@ String.prototype.toURLArray = function() // {{{
// or keyword bookmark // or keyword bookmark
if (/\s/.test(urls[url]) || !/[.:\/]/.test(urls[url])) if (/\s/.test(urls[url]) || !/[.:\/]/.test(urls[url]))
{ {
matches = urls[url].match(/^(\S+)(?:\s+(.+))?$/) matches = urls[url].match(/^(\S+)(?:\s+(.+))?$/);
var alias = matches[1]; var alias = matches[1];
var text = matches[2] ? matches[2] : null; var text = matches[2] ? matches[2] : null;