diff --git a/chrome/content/vimperator/bookmarks.js b/chrome/content/vimperator/bookmarks.js index 7e12984a..8c075232 100644 --- a/chrome/content/vimperator/bookmarks.js +++ b/chrome/content/vimperator/bookmarks.js @@ -127,7 +127,8 @@ function Bookmarks() //{{{ { bmResource = bmResources.getNext(); type = BookmarksUtils.resolveType(bmResource); - if (type != "ImmutableBookmark") { + if (type != "ImmutableBookmark") + { ptype = BookmarksUtils.resolveType(BMSVC.getParent(bmResource)); // alert(type); // if ( type == "Folder") // store the current folder @@ -172,7 +173,7 @@ function Bookmarks() //{{{ var newalias = alias; for (var j = 1; j <= 10; j++) // <=10 is intentional { - if (!search_engines.some( function(item) { return (item[0] == newalias); } )) + if (!search_engines.some(function(item) { return (item[0] == newalias); })) break; newalias = alias + j; diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index ae7c57af..3747f5aa 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -556,8 +556,14 @@ function Commands() //{{{ { vimperator.commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"), function(code) { - try { eval(matches[1] + "\n" + code); } - catch (e) { vimperator.echoerr(e.name + ": " + e.message); } + try + { + eval(matches[1] + "\n" + code); + } + catch (e) + { + vimperator.echoerr(e.name + ": " + e.message); + } }); } else // single line javascript code @@ -654,11 +660,13 @@ function Commands() //{{{ addDefaultCommand(new Command(["ma[rk]"], function(args) { - if (!args) { + if (!args) + { vimperator.echoerr("E471: Argument required"); return; } - if (args.length > 1) { + if (args.length > 1) + { vimperator.echoerr("E488: Trailing characters"); return; } @@ -823,7 +831,8 @@ function Commands() //{{{ addDefaultCommand(new Command(["qma[rk]"], function(args) { - if (!args) { + if (!args) + { vimperator.echoerr("E471: Argument required"); return; } diff --git a/chrome/content/vimperator/completion.js b/chrome/content/vimperator/completion.js index 2c7c4d8b..122f63f0 100644 --- a/chrome/content/vimperator/completion.js +++ b/chrome/content/vimperator/completion.js @@ -39,7 +39,7 @@ vimperator.completion = (function() // {{{ //var filter_length = filter.length; //filter = filter.toLowerCase(); var ignorecase = false; - if(filter == filter.toLowerCase()) + if (filter == filter.toLowerCase()) ignorecase = true; for (var i = 0; i < list.length; i++) @@ -47,7 +47,7 @@ vimperator.completion = (function() // {{{ for (var j = 0; j < list[i][0].length; j++) { var item = list[i][0][j]; - if(ignorecase) + if (ignorecase) item = item.toLowerCase(); if (item.indexOf(filter) == -1) @@ -122,7 +122,7 @@ vimperator.completion = (function() // {{{ //var filter_length = filter.length; var ignorecase = false; - if(filter == filter.toLowerCase()) + if (filter == filter.toLowerCase()) ignorecase = true; /* @@ -134,7 +134,7 @@ vimperator.completion = (function() // {{{ { var url = urls[i][0] || ""; var title = urls[i][1] || ""; - if(ignorecase) + if (ignorecase) { url = url.toLowerCase(); title = title.toLowerCase(); @@ -257,9 +257,12 @@ vimperator.completion = (function() // {{{ return []; var compl = match[2] || ''; - try { + try + { var fd = vimperator.fopen(dir, "<"); - } catch(e) { + } + catch(e) + { // thrown if file does not exist return [ ]; } @@ -369,7 +372,7 @@ vimperator.completion = (function() // {{{ } // check if filter ends with =, then complete current value - else if(filter.length > 0 && filter.lastIndexOf("=") == filter.length -1) + else if (filter.length > 0 && filter.lastIndexOf("=") == filter.length -1) { filter = filter.substr(0, filter.length-1); for (var option in vimperator.options) @@ -459,7 +462,7 @@ vimperator.completion = (function() // {{{ // if there is no space between the command name and the cursor // then get completions of the command name var matches = str.match(/^(:*\d*)\w*$/); - if(matches) + if (matches) { completions = this.get_command_completions(cmd); start = matches[1].length; diff --git a/chrome/content/vimperator/default.css b/chrome/content/vimperator/default.css index 2742b809..4599d43b 100644 --- a/chrome/content/vimperator/default.css +++ b/chrome/content/vimperator/default.css @@ -148,8 +148,8 @@ fieldset.paypal { #vimperator-bufferwindow > listitem[selected="true"], #vimperator-previewwindow > listitem[selected="true"] { - background-color: Highlight !important; - color: HighlightText !important; + background-color: Highlight !important; + color: HighlightText !important; } diff --git a/chrome/content/vimperator/events.js b/chrome/content/vimperator/events.js index 90cee437..df4b0641 100644 --- a/chrome/content/vimperator/events.js +++ b/chrome/content/vimperator/events.js @@ -265,7 +265,7 @@ function Events() //{{{ evt.initKeyEvent('keypress', true, true, view, ctrl, alt, shift, meta, keyCode, charCode ); var elem = window.document.commandDispatcher.focusedElement; - if(!elem) + if (!elem) elem = window; elem.dispatchEvent(evt); @@ -278,7 +278,7 @@ function Events() //{{{ // null if unknown key this.toString = function(event) //{{{ { - if(!event) + if (!event) return; var key = null; diff --git a/chrome/content/vimperator/file.js b/chrome/content/vimperator/file.js index 455f08d7..966ed7f4 100644 --- a/chrome/content/vimperator/file.js +++ b/chrome/content/vimperator/file.js @@ -132,7 +132,7 @@ function fo_read(max) { var entries = this.localFile.directoryEntries; var array = []; - while(entries.hasMoreElements()) + while (entries.hasMoreElements()) { var entry = entries.getNext(); entry.QueryInterface(Components.interfaces.nsIFile); diff --git a/chrome/content/vimperator/find.js b/chrome/content/vimperator/find.js index f5295dab..28cba68d 100644 --- a/chrome/content/vimperator/find.js +++ b/chrome/content/vimperator/find.js @@ -196,7 +196,7 @@ function clearHighlight() var docfrag = doc.createDocumentFragment(); var next = elem.nextSibling; var parent = elem.parentNode; - while((child = elem.firstChild)) { + while ((child = elem.firstChild)) { docfrag.appendChild(child); } parent.removeChild(elem); diff --git a/chrome/content/vimperator/ui.js b/chrome/content/vimperator/ui.js index 36459f99..9cb330eb 100644 --- a/chrome/content/vimperator/ui.js +++ b/chrome/content/vimperator/ui.js @@ -165,7 +165,7 @@ function CommandLine() //{{{ function autosizeMultilineInputWidget() { // XXX: faster/better method? - + var lines = 0; var str = multiline_input_widget.value; for (var i = 0; i < str.length; i++) @@ -652,7 +652,10 @@ function InformationList(id, options) //{{{ // remove all old items first var items = widget.getElementsByTagName("listitem"); - while (items.length > 0) { widget.removeChild(items[0]);} + while (items.length > 0) + { + widget.removeChild(items[0]); + } if (!incremental_fill) { diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js index 5610bc88..1250709f 100644 --- a/chrome/content/vimperator/vimperator.js +++ b/chrome/content/vimperator/vimperator.js @@ -326,9 +326,14 @@ const vimperator = (function() //{{{ for (var i in object) { var value; - try { + try + { var value = object[i]; - } catch (e) { value = '' } + } + catch (e) + { + value = ''; + } string += i + ': ' + value + '\n'; } @@ -594,7 +599,7 @@ const vimperator = (function() //{{{ vimperator.source(file.path, false); }); } - catch(e) + catch (e) { // thrown if directory does not exist //vimperator.log("Error sourcing plugin directory: " + e);