diff --git a/common/content/buffer.js b/common/content/buffer.js index 9ddf9ba4..aff55af2 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -32,7 +32,7 @@ const Point = new Struct("x", "y"); /** * A class to manage the primary web content buffer. The name comes - * from vim's term, 'buffer', which signifies instances of open + * from Vim's term, 'buffer', which signifies instances of open * files. * @instance buffer */ @@ -1428,8 +1428,8 @@ function Marks() //{{{ ////////////////////// PRIVATE SECTION ///////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - var localMarks = storage.newMap('local-marks', true); - var urlMarks = storage.newMap('url-marks', true); + var localMarks = storage.newMap("local-marks", true); + var urlMarks = storage.newMap("url-marks", true); var pendingJumps = []; var appContent = document.getElementById("appcontent"); @@ -1457,7 +1457,7 @@ function Marks() //{{{ return name + ", " + mark.location + ", (" + Math.round(mark.position.x * 100) + "%, " + Math.round(mark.position.y * 100) + "%)" + - (('tab' in mark) ? ", tab: " + tabs.index(mark.tab) : ""); + (("tab" in mark) ? ", tab: " + tabs.index(mark.tab) : ""); } function removeLocalMark(mark) diff --git a/common/content/commands.js b/common/content/commands.js index 6e74f680..15726961 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -924,7 +924,7 @@ function Commands() //{{{ [["-count"], commandManager.OPTION_NOARG], [["-complete"], commandManager.OPTION_STRING, function (arg) arg in completeOptionMap || /custom,\w+/.test(arg), - function (context) [[k, ''] for ([k, v] in Iterator(completeOptionMap))]] + function (context) [[k, ""] for ([k, v] in Iterator(completeOptionMap))]] ], literal: 1, serial: function () [ diff --git a/common/content/completion.js b/common/content/completion.js index fd465199..63e803aa 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1338,6 +1338,7 @@ function Completion() //{{{ context.completions = config.autocommands; }, + // TODO: shouldn't these app-specific completers be moved to config.js? --djk bookmark: function bookmark(context, tags, extra) { context.title = ["Bookmark", "Title"]; diff --git a/common/content/eval.js b/common/content/eval.js index daf0dba6..ff7310e2 100644 --- a/common/content/eval.js +++ b/common/content/eval.js @@ -4,7 +4,7 @@ catch (e) { __liberator_eval_error = e; } -// Important: The eval statement *must* remain on the first line +// IMPORTANT: The eval statement *must* remain on the first line // in order for line numbering in any errors to remain correct. // // vim: set fdm=marker sw=4 ts=4 et: diff --git a/common/content/events.js b/common/content/events.js index 7c12af22..bb1c51f5 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -299,7 +299,7 @@ function Events() //{{{ var inputBufferLength = 0; // count the number of keys in v.input.buffer (can be different from v.input.buffer.length) var skipMap = false; // while feeding the keys (stored in v.input.buffer | no map found) - ignore mappings - var macros = storage.newMap('macros', true); + var macros = storage.newMap("macros", true); var currentMacro = ""; var lastMacro = ""; @@ -806,7 +806,7 @@ function Events() //{{{ { if (lastMacro.length == 1) // TODO: ignore this like Vim? - liberator.echoerr("Exxx: Register " + lastMacro + " not set"); + liberator.echoerr("Exxx: Register '" + lastMacro + "' not set"); else liberator.echoerr("Exxx: Named macro '" + lastMacro + "' not set"); } diff --git a/common/content/help.js b/common/content/help.js index c2ee6b87..12a639a8 100644 --- a/common/content/help.js +++ b/common/content/help.js @@ -9,3 +9,4 @@ let url = page ? "chrome://liberator/locale/" + page : content.history.previous; win.getBrowser().loadURIWithFlags(url, Components.interfaces.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY, null, null, null); +// vim: set fdm=marker sw=4 ts=4 et: diff --git a/common/content/liberator.js b/common/content/liberator.js index 375b02fe..5df2e899 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -1113,6 +1113,7 @@ const liberator = (function () //{{{ break; default: + // FIXME: should this really be a user-visible error? --djk liberator.echoerr("Exxx: Invalid 'where' directive in liberator.open(...)"); return false; } diff --git a/common/content/tabs.js b/common/content/tabs.js index 50d791bb..cff3cf06 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -44,12 +44,12 @@ function Tabs() //{{{ { if (!tabmail) { - tabmail = document.getElementById('tabmail'); - tabmail.__defineGetter__('mTabContainer', function () this.tabContainer); - tabmail.__defineGetter__('mTabs', function () this.tabContainer.childNodes); - tabmail.__defineGetter__('mCurrentTab', function () this.tabContainer.selectedItem); - tabmail.__defineGetter__('mStrip', function () this.tabStrip); - tabmail.__defineGetter__('browsers', function () [browser for (browser in Iterator(this.mTabs))] ); + tabmail = document.getElementById("tabmail"); + tabmail.__defineGetter__("mTabContainer", function () this.tabContainer); + tabmail.__defineGetter__("mTabs", function () this.tabContainer.childNodes); + tabmail.__defineGetter__("mCurrentTab", function () this.tabContainer.selectedItem); + tabmail.__defineGetter__("mStrip", function () this.tabStrip); + tabmail.__defineGetter__("browsers", function () [browser for (browser in Iterator(this.mTabs))] ); } return tabmail; }; @@ -123,7 +123,7 @@ function Tabs() //{{{ let tabStrip = tabs.tabStrip; if (!tabStrip) - return options['showtabline']; // XXX + return options["showtabline"]; // XXX if (value == 0) { diff --git a/common/content/ui.js b/common/content/ui.js index 8f7082fb..b0edf3e5 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -95,7 +95,7 @@ function CommandLine() //{{{ let str = this.input.value; if (/^\s*$/.test(str)) return; - this.store.mutate('filter', function (line) line != str); + this.store.mutate("filter", function (line) line != str); this.store.push(str); this.store.truncate(options["history"], true); }, diff --git a/common/content/util.js b/common/content/util.js index ac63871e..d1877ec4 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -452,8 +452,8 @@ const util = { //{{{ try { - const clipboard = Cc['@mozilla.org/widget/clipboard;1'].getService(Ci.nsIClipboard); - const transferable = Cc['@mozilla.org/widget/transferable;1'].createInstance(Ci.nsITransferable); + const clipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard); + const transferable = Cc["@mozilla.org/widget/transferable;1"].createInstance(Ci.nsITransferable); transferable.addDataFlavor("text/unicode"); diff --git a/vimperator/content/bookmarks.js b/vimperator/content/bookmarks.js index a7b5db6f..eead2a86 100644 --- a/vimperator/content/bookmarks.js +++ b/vimperator/content/bookmarks.js @@ -65,16 +65,16 @@ function Bookmarks() //{{{ // Error: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIObserverService.addObserver]" // nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" // location: "JS frame :: file://~firefox/components/nsTaggingService.js :: anonymous :: line 89" - // data: no] - // Source file: file://~firefox/components/nsTaggingService.js + // data: no] + // Source file: file://~firefox/components/nsTaggingService.js taggingService.getTagsForURI(window.makeURI("http://mysterious.bug"), {}); const Bookmark = new Struct("url", "title", "icon", "keyword", "tags", "id"); const Keyword = new Struct("keyword", "title", "icon", "url"); Bookmark.defaultValue("icon", function () getFavicon(this.url)); Bookmark.prototype.__defineGetter__("extra", function () [ - ['keyword', this.keyword, "Keyword"], - ['tags', this.tags.join(', '), "Tag"] + ["keyword", this.keyword, "Keyword"], + ["tags", this.tags.join(", "), "Tag"] ].filter(function (item) item[1])); const storage = modules.storage; @@ -700,7 +700,7 @@ function History() //{{{ "Go back in the browser history", function (args) { - args = args.string; + let url = args.literalArg; if (args.bang) { @@ -708,12 +708,12 @@ function History() //{{{ } else { - if (args) + if (url) { let sh = window.getWebNavigation().sessionHistory; - for (let i = sh.index - 1; i >= 0; i--) + for (let i in util.range(sh.index, 0, true)) { - if (sh.getEntryAtIndex(i, false).URI.spec == args) + if (sh.getEntryAtIndex(i, false).URI.spec == url) { window.getWebNavigation().gotoIndex(i); return; @@ -723,7 +723,7 @@ function History() //{{{ } else { - history.stepTo(args.count > 0 ? -1 * args.count : -1); + history.stepTo(-Math.max(args.count, 1)); } } }, @@ -746,7 +746,7 @@ function History() //{{{ "Go forward in the browser history", function (args) { - args = args.string; + let url = args.literalArg; if (args.bang) { @@ -754,12 +754,12 @@ function History() //{{{ } else { - if (args) + if (url) { let sh = window.getWebNavigation().sessionHistory; for (let i in util.range(sh.index + 1, sh.count)) { - if (sh.getEntryAtIndex(i, false).URI.spec == args) + if (sh.getEntryAtIndex(i, false).URI.spec == url) { window.getWebNavigation().gotoIndex(i); return; @@ -769,7 +769,7 @@ function History() //{{{ } else { - history.stepTo(args.count > 0 ? args.count : 1); + history.stepTo(Math.max(args.count, 1)); } } }, @@ -845,31 +845,30 @@ function History() //{{{ if (index >= 0 && index < window.getWebNavigation().sessionHistory.count) window.getWebNavigation().gotoIndex(index); else - liberator.beep(); + liberator.beep(); // XXX: really wanted? }, goToStart: function goToStart() { let index = window.getWebNavigation().sessionHistory.index; - if (index == 0) - { - liberator.beep(); // XXX: really wanted? - return; - } - window.getWebNavigation().gotoIndex(0); + if (index > 0) + window.getWebNavigation().gotoIndex(0); + else + liberator.beep(); // XXX: really wanted? + }, goToEnd: function goToEnd() { - let index = window.getWebNavigation().sessionHistory.index; - if (index == window.getWebNavigation().sessionHistory.count - 1) - { - liberator.beep(); - return; - } + let sh = window.getWebNavigation().sessionHistory; + let max = sh.count - 1; + + if (sh.index < max) + window.getWebNavigation().gotoIndex(max); + else + liberator.beep(); // XXX: really wanted? - window.getWebNavigation().gotoIndex(max); }, // if openItems is true, open the matching history items in tabs rather than display diff --git a/vimperator/locale/en-US/asciidoc.conf b/vimperator/locale/en-US/asciidoc.conf index 0a76bab0..ff6fda1e 100644 --- a/vimperator/locale/en-US/asciidoc.conf +++ b/vimperator/locale/en-US/asciidoc.conf @@ -25,16 +25,6 @@ email=stubenschrott@gmx.net LOGO=