diff --git a/content/bookmarks.js b/content/bookmarks.js
index 431cf5fc..58ded943 100644
--- a/content/bookmarks.js
+++ b/content/bookmarks.js
@@ -48,7 +48,7 @@ vimperator.Bookmarks = function () //{{{
var keywords = null;
if (vimperator.options["preload"])
- setTimeout(function () { load(); } , 100);
+ setTimeout(function () { load(); }, 100);
function load()
{
@@ -344,7 +344,7 @@ vimperator.History = function () //{{{
var history = null;
if (vimperator.options["preload"])
- setTimeout(function () { load(); } , 100);
+ setTimeout(function () { load(); }, 100);
function load()
{
diff --git a/content/buffers.js b/content/buffers.js
index 8e3bf52c..54b59fc7 100644
--- a/content/buffers.js
+++ b/content/buffers.js
@@ -177,8 +177,10 @@ vimperator.Buffer = function () //{{{
elem = doc;
var result = doc.evaluate(expression, elem,
- function lookupNamespaceURI(prefix) {
- switch (prefix) {
+ function lookupNamespaceURI(prefix)
+ {
+ switch (prefix)
+ {
case "xhtml":
return "http://www.w3.org/1999/xhtml";
default:
@@ -725,8 +727,8 @@ vimperator.Buffer = function () //{{{
}
// sort: ignore-case
- tmpSort.sort(function (a,b){return a.toLowerCase() > b.toLowerCase() ? 1 : -1;});
- for (var i=0; i < tmpSort.length; i++)
+ tmpSort.sort(function (a, b) { return a.toLowerCase() > b.toLowerCase() ? 1 : -1; });
+ for (var i = 0; i < tmpSort.length; i++)
pageMeta.push([tmpDict[tmpSort[i]][0], vimperator.util.highlightURL(tmpDict[tmpSort[i]][1], false)]);
}
@@ -791,15 +793,15 @@ vimperator.Buffer = function () //{{{
}
relText = new RegExp(relText, "i");
- var elems = window.content.document.getElementsByTagName('a');
- for (pattern = 0; pattern < regexps.length; pattern++)
+ var elems = window.content.document.getElementsByTagName("a");
+ for (var pattern = 0; pattern < regexps.length; pattern++)
{
patternText = new RegExp(regexps[pattern], "i");
- for (i = 0; i < elems.length; i++)
+ for (var i = 0; i < elems.length; i++)
{
if (patternText.test(elems[i].text) || relText.test(elems[i].rel) )
{
- vimperator.buffer.followLink(elems[i],vimperator.CURRENT_TAB);
+ vimperator.buffer.followLink(elems[i], vimperator.CURRENT_TAB);
return;
}
}
diff --git a/content/commands.js b/content/commands.js
index 5f437bb6..1ba1c3db 100644
--- a/content/commands.js
+++ b/content/commands.js
@@ -620,7 +620,7 @@ vimperator.Commands = function () //{{{
" -keyword=keyword
",
args: [[["-title", "-t"], OPTION_STRING],
[["-tags", "-T"], OPTION_LIST],
- [["-keyword", "-k"], OPTION_STRING, function (arg) { return /\w/.test(arg); } ]]
+ [["-keyword", "-k"], OPTION_STRING, function (arg) { return /\w/.test(arg); }]]
}
));
addDefaultCommand(new vimperator.Command(["bmarks"],
@@ -709,7 +709,7 @@ vimperator.Commands = function () //{{{
usage: ["com[mand][!] [{attr}...] {cmd} {rep}"],
short_help: "Temporarily used for testing args parser",
help: "",
- args: [[["-nargs"], OPTION_STRING, function (arg) { return /^(0|1|\*|\?|\+)$/.test(arg); } ],
+ args: [[["-nargs"], OPTION_STRING, function (arg) { return /^(0|1|\*|\?|\+)$/.test(arg); }],
[["-bang"], OPTION_NOARG],
[["-bar"], OPTION_NOARG]]
}
@@ -975,7 +975,8 @@ 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);
@@ -1045,14 +1046,21 @@ vimperator.Commands = function () //{{{
{
var reference = vimperator.variableReference(matches[2]);
if (!reference[0] && matches[3])
- return vimperator.echoerr("E121: Undefined variable: " + matches[2]);
+ {
+ vimperator.echoerr("E121: Undefined variable: " + matches[2]);
+ return;
+ }
var expr = vimperator.eval(matches[4]);
if (typeof expr === undefined)
- return vimperator.echoerr("E15: Invalid expression: " + matches[4]);
+ {
+ vimperator.echoerr("E15: Invalid expression: " + matches[4]);
+ return;
+ }
else
{
- if (!reference[0]) {
+ if (!reference[0])
+ {
if (reference[2] == "g")
reference[0] = vimperator.globalVariables;
else
@@ -1078,7 +1086,10 @@ vimperator.Commands = function () //{{{
{
var reference = vimperator.variableReference(matches[1]);
if (!reference[0])
- return vimperator.echoerr("E121: Undefined variable: " + matches[1]);
+ {
+ vimperator.echoerr("E121: Undefined variable: " + matches[1]);
+ return;
+ }
var value = reference[0][reference[1]];
if (typeof value == "number")
@@ -2164,7 +2175,10 @@ vimperator.Commands = function () //{{{
function (args, special)
{
if (!args)
- return vimperator.echoerr("E471: Argument required");
+ {
+ vimperator.echoerr("E471: Argument required");
+ return;
+ }
var names = args.split(/ /);
if (typeof names == "string") names = [names];
diff --git a/content/editor.js b/content/editor.js
index 9d8d9a8a..c6b4dd0d 100644
--- a/content/editor.js
+++ b/content/editor.js
@@ -98,7 +98,7 @@ vimperator.Editor = function () //{{{
{
var rangeStart = elt.selectionStart; // caret position
var rangeEnd = elt.selectionEnd;
- var tempStr1 = elt.value.substring(0,rangeStart);
+ var tempStr1 = elt.value.substring(0, rangeStart);
var tempStr2 = readFromClipboard();
var tempStr3 = elt.value.substring(rangeEnd);
elt.value = tempStr1 + tempStr2 + tempStr3;
@@ -383,11 +383,11 @@ vimperator.Editor = function () //{{{
// blink the textbox after returning
var timeout = 100;
textBox.style.backgroundColor = tmpBg;
- setTimeout( function () {
+ setTimeout(function () {
textBox.style.backgroundColor = oldBg;
- setTimeout( function () {
+ setTimeout(function () {
textBox.style.backgroundColor = tmpBg;
- setTimeout( function () {
+ setTimeout(function () {
textBox.style.backgroundColor = oldBg;
}, timeout);
}, timeout);
diff --git a/content/help.js b/content/help.js
index c6a49688..28f71680 100644
--- a/content/help.js
+++ b/content/help.js
@@ -229,7 +229,7 @@ vimperator.help = function (section, easter) //{{{
return false;
vimperator.open("about:blank");
- setTimeout(function () { vimperator.help(section, false, null, {recursive: true}); }, 250);
+ setTimeout(function () { vimperator.help(section, false, null, { recursive: true }); }, 250);
return;
}
doc.write(fulldoc);
diff --git a/content/hints.js b/content/hints.js
index 2b478d29..cde285c3 100644
--- a/content/hints.js
+++ b/content/hints.js
@@ -418,7 +418,7 @@ vimperator.Hints = function () //{{{
var first_href = valid_hints[0].getAttribute("href") || null;
if (first_href)
{
- if (valid_hints.some( function (e) { return e.getAttribute("href") != first_href; } ))
+ if (valid_hints.some(function (e) { return e.getAttribute("href") != first_href; }))
return false;
}
else if (valid_hints.length > 1)
@@ -458,7 +458,7 @@ vimperator.Hints = function () //{{{
}
else
{
- setTimeout( function () {
+ setTimeout(function () {
if (vimperator.mode == vimperator.modes.HINTS)
vimperator.modes.reset(false);
}, timeout);
diff --git a/content/mappings.js b/content/mappings.js
index 5b2af960..af3e6e74 100644
--- a/content/mappings.js
+++ b/content/mappings.js
@@ -415,7 +415,7 @@ vimperator.Mappings = function () //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["]n"],
- function (count) {vimperator.buffer.followDocumentRelation("next");},
+ function (count) { vimperator.buffer.followDocumentRelation("next"); },
{
short_help: "go to 'next' or '>' if it exists. Beep otherwise.",
help: "Opens link labeled with next or >. Useful when browsing forums or documentation. Change nextpattern to modify its behaviour. It follows relations between files too.",
@@ -423,7 +423,7 @@ vimperator.Mappings = function () //{{{
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["]p"],
- function (count) {vimperator.buffer.followDocumentRelation("previous");},
+ function (count) { vimperator.buffer.followDocumentRelation("previous"); },
{
short_help: "go to 'prev', 'previous' or '<' if it exists. Beep otherwise.",
help: "Opens link labeled with prev, previous or <. Useful when browsing forums or documentation. Change nextpattern to modify its behaviour. It follows relations between files too.",
diff --git a/content/options.js b/content/options.js
index 426475d1..8b753f9e 100644
--- a/content/options.js
+++ b/content/options.js
@@ -464,7 +464,6 @@ vimperator.Options = function () //{{{
short_help: "Set the default search engine",
help: "The default search engine is used in the :[tab]open [arg] command " +
"if [arg] neither looks like a URL or like a specified search engine/keyword.",
- completer: function () { return [["foo", "bar"], ["shit", "blub"]]; },
default_value: "google"
}
));
diff --git a/content/vimperator.js b/content/vimperator.js
index b6ba570e..f811ccd1 100644
--- a/content/vimperator.js
+++ b/content/vimperator.js
@@ -709,9 +709,8 @@ const vimperator = (function () //{{{
var mainThread = threadManager.mainThread;
var then = new Date().getTime(), now = then;
- for (; now - then < ms; now = new Date().getTime()) {
+ for (; now - then < ms; now = new Date().getTime())
mainThread.processNextEvent(true);
- }
},
get windows()