diff --git a/common/content/mappings.js b/common/content/mappings.js index d409ba79..d47501b3 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -59,7 +59,7 @@ Map.prototype = { execute: function (motion, count, argument) { - var args = []; + let args = []; if (this.flags & Mappings.flags.MOTION) args.push(motion); @@ -98,7 +98,7 @@ function Mappings() //{{{ function addMap(map, userMap) { - var where = userMap ? user : main; + let where = userMap ? user : main; map.modes.forEach(function (mode) { if (!(mode in where)) where[mode] = []; @@ -108,7 +108,7 @@ function Mappings() //{{{ function getMap(mode, cmd, stack) { - var maps = stack[mode] || []; + let maps = stack[mode] || []; for (let [,map] in Iterator(maps)) { @@ -121,8 +121,8 @@ function Mappings() //{{{ function removeMap(mode, cmd) { - var maps = user[mode] || []; - var names; + let maps = user[mode] || []; + let names; for (let [i, map] in Iterator(maps)) { @@ -305,7 +305,7 @@ function Mappings() //{{{ addUserMap: function (modes, keys, description, action, extra) { keys = keys.map(expandLeader); - var map = new Map(modes, keys, description || "User defined mapping", action, extra); + let map = new Map(modes, keys, description || "User defined mapping", action, extra); // remove all old mappings to this key sequence for (let [,name] in Iterator(map.names)) @@ -353,7 +353,7 @@ function Mappings() //{{{ getMapLeader: function () { - var leaderRef = liberator.variableReference("mapleader"); + let leaderRef = liberator.variableReference("mapleader"); return leaderRef[0] ? leaderRef[0][leaderRef[1]] : "\\"; }, diff --git a/common/content/modes.js b/common/content/modes.js index e79a67f4..fc4195c5 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -54,13 +54,13 @@ const modes = (function () //{{{ return "-- PASS THROUGH --"; // when recording a macro - var macromode = ""; + let macromode = ""; if (modes.isRecording) macromode = "recording"; else if (modes.isReplaying) macromode = "replaying"; - var ext = ""; + let ext = ""; if (extended & modes.MENU) // TODO: desirable? ext += " (menu)"; ext += " --" + macromode; @@ -199,7 +199,7 @@ const modes = (function () //{{{ pop: function (silent) { - var a = modeStack.pop(); + let a = modeStack.pop(); if (a) this.set(a[0], a[1], silent); else diff --git a/common/content/options.js b/common/content/options.js index a1844a5f..0a244ab3 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -117,7 +117,7 @@ Option.prototype = { scope = this.scope; } - var aValue; + let aValue; if (liberator.has("tabs") && (scope & options.OPTION_SCOPE_LOCAL)) aValue = tabs.options[this.name]; @@ -334,7 +334,7 @@ function Options() //{{{ prefContexts[prefContexts.length - 1][name] = val; } - var type = prefService.getPrefType(name); + let type = prefService.getPrefType(name); switch (typeof value) { case "string": @@ -439,7 +439,7 @@ function Options() //{{{ if (!args) { - var str = + let str = { template.map(liberator.globalVariables, function ([i, value]) { @@ -460,20 +460,20 @@ function Options() //{{{ return; } - var matches; + let matches; // 1 - type, 2 - name, 3 - +-., 4 - expr if (matches = args.match(/([$@&])?([\w:]+)\s*([-+.])?=\s*(.+)/)) { if (!matches[1]) { - var reference = liberator.variableReference(matches[2]); + let reference = liberator.variableReference(matches[2]); if (!reference[0] && matches[3]) { liberator.echoerr("E121: Undefined variable: " + matches[2]); return; } - var expr = liberator.evalExpression(matches[4]); + let expr = liberator.evalExpression(matches[4]); if (expr === undefined) { liberator.echoerr("E15: Invalid expression: " + matches[4]); @@ -506,14 +506,14 @@ function Options() //{{{ // 1 - name else if (matches = args.match(/^\s*([\w:]+)\s*$/)) { - var reference = liberator.variableReference(matches[1]); + let reference = liberator.variableReference(matches[1]); if (!reference[0]) { liberator.echoerr("E121: Undefined variable: " + matches[1]); return; } - var value = reference[0][reference[1]]; + let value = reference[0][reference[1]]; let prefix = typeof value == "number" ? "#" : typeof value == "function" ? "*" : " "; @@ -567,9 +567,9 @@ function Options() //{{{ { if (bang) { - var onlyNonDefault = false; - var reset = false; - var invertBoolean = false; + let onlyNonDefault = false; + let reset = false; + let invertBoolean = false; if (args[0] == "") { @@ -685,7 +685,6 @@ function Options() //{{{ completer: function (context, args, modifiers) { let filter = context.filter; - var optionCompletions = []; if (args.bang) // list completions for about:config entries { @@ -758,15 +757,15 @@ function Options() //{{{ "Delete a variable", function (args) { - //var names = args.split(/ /); + //let names = args.split(/ /); //if (typeof names == "string") names = [names]; - //var length = names.length; + //let length = names.length; //for (let i = 0, name = names[i]; i < length; name = names[++i]) for (let [,name] in args) { - var name = args[i]; - var reference = liberator.variableReference(name); + let name = args[i]; + let reference = liberator.variableReference(name); if (!reference[0]) { if (!args.bang) @@ -894,7 +893,7 @@ function Options() //{{{ if (!filter) filter = ""; - var prefArray = prefService.getChildList("", { value: 0 }); + let prefArray = prefService.getChildList("", { value: 0 }); prefArray.sort(); let prefs = function () { for each (let pref in prefArray) diff --git a/common/content/ui.js b/common/content/ui.js index 44061a55..8eadbf3e 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -809,7 +809,7 @@ function CommandLine() //{{{ command.description, function (args) { - var str = echoArgumentToString(args.string, true); + let str = echoArgumentToString(args.string, true); if (str != null) command.action(str); }, diff --git a/vimperator/NEWS b/vimperator/NEWS index f982feda..4fd0ddaf 100644 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -20,6 +20,7 @@ * IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and VimperatorLeave respectively * IMPORTANT: 'verbose' is now by default at 1, set to 0 to not show any status messages + * IMPORTANT: option values containing whitespace must now be quoted E.g. :set editor=gvim\ -f * :hardcopy now supports output redirection to a file on Unix and MacUnix * add ";f" extended hint mode to focus a frame