From 6451646b0ce55a0933bae21a50834a0eda9df7b5 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 24 Dec 2010 05:59:23 -0500 Subject: [PATCH 1/3] Remove some untoward dump statements that snuck into the last commit. --- common/content/dactyl.js | 1 - common/content/modes.js | 1 - 2 files changed, 2 deletions(-) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 51c8617e..a10c5f19 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -372,7 +372,6 @@ const Dactyl = Module("dactyl", { focus: function focus(elem, flags) { flags = flags || services.focus.FLAG_BYMOUSE; - util.dumpStack(); try { if (elem instanceof Document) elem = elem.defaultView; diff --git a/common/content/modes.js b/common/content/modes.js index 715d4b0e..c59e85b6 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -286,7 +286,6 @@ const Modes = Module("modes", { }, push: function push(mainMode, extendedMode, params) { - util.dumpStack(); this.set(mainMode, extendedMode, params, { push: this.topOfStack }); }, From 879cb522796185bee4de57df5705a234e980e931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Fri, 24 Dec 2010 17:43:31 +0100 Subject: [PATCH 2/3] Fix some typos. --- common/content/configbase.js | 4 ++-- common/content/mappings.js | 2 +- common/locale/en-US/options.xml | 2 +- common/locale/en-US/various.xml | 2 +- common/modules/base.jsm | 2 +- common/modules/util.jsm | 2 +- pentadactyl/NEWS | 8 ++++---- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/content/configbase.js b/common/content/configbase.js index fa3de669..e9e9800d 100644 --- a/common/content/configbase.js +++ b/common/content/configbase.js @@ -100,7 +100,7 @@ const ConfigBase = Class(ModuleBase, { host: null, /** - * @property {Object} A map between key names for key events should be ignored, + * @property {Object} A map between key names for key events which should be ignored, * and a mask of the modes in which they should be ignored. */ ignoreKeys: {}, // NOTE: be aware you can't put useful values in here, as "modes.NORMAL" etc. are not defined at this time @@ -196,7 +196,7 @@ const ConfigBase = Class(ModuleBase, { !CmdLine;>* font-family: monospace !important; padding: 1px !important; CmdPrompt;.dactyl-commandline-prompt CmdInput;.dactyl-commandline-command - CmdOutput white-space: pre; + CmdOutput white-space: pre; CompGroup diff --git a/common/content/mappings.js b/common/content/mappings.js index 8c6a25f2..d9281d88 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -481,7 +481,7 @@ const Mappings = Module("mappings", { options: [ update({}, modeFlag, { names: ["-modes", "-mode", "-m"], type: CommandOption.LIST, - description: "Clear mappings from the given modes", + description: "Remove all mappings from the given modes", default: mapmodes || ["n", "v"], }), ] diff --git a/common/locale/en-US/options.xml b/common/locale/en-US/options.xml index 95468c03..994d5863 100644 --- a/common/locale/en-US/options.xml +++ b/common/locale/en-US/options.xml @@ -725,7 +725,7 @@ number 0 -

Changes how soon matching hints are followed in in Hints mode.

+

Changes how soon matching hints are followed in Hints mode.

Possible values:

diff --git a/common/locale/en-US/various.xml b/common/locale/en-US/various.xml index 327a7897..7abb0115 100644 --- a/common/locale/en-US/various.xml +++ b/common/locale/en-US/various.xml @@ -38,7 +38,7 @@

Fake key events.

-
-mode
The in which to feed the keys (short name: -m)
+
-mode
The mode in which to feed the keys (short name: -m)
diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 19529316..c08cd304 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -1130,7 +1130,7 @@ const array = Class("array", Array, { * Returns the nth member of the given array that matches the * given predicate. */ - nth: function first(ary, pred, n, self) { + nth: function nth(ary, pred, n, self) { for (let elem in values(ary)) if (pred.call(self, elem) && n-- === 0) return elem; diff --git a/common/modules/util.jsm b/common/modules/util.jsm index 3d9f7c61..15cfcb82 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -256,7 +256,7 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]) return stack.top; }, - compileMacro: function compileFormat(macro, keepUnknown) { + compileMacro: function compileMacro(macro, keepUnknown) { let stack = [frame()]; stack.__defineGetter__("top", function () this[this.length - 1]); diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS index 459b8b84..be34680f 100644 --- a/pentadactyl/NEWS +++ b/pentadactyl/NEWS @@ -61,7 +61,7 @@ - Added -keyword, -tags, -title to :delbmarks. - Added :extupdate command. - Added :feedkeys command. - - Added -sort option to :history + - Added -sort option to :history. - Added several new options, including -javascript, to :abbrev and :map. - Added :mksyntax command. - :open now only opens files beginning with /, ./, ../, or ~/ @@ -71,15 +71,15 @@ - Added -agent flag to :style. - The -append flag now updates existing properties rather than simply appending its arguments to the previous value. - - Active filters are not highlighted in :style listings + - Active filters are not highlighted in :style listings. - :style-related commands now divide their completions between those active and inactive for the current site. - - CSS property name completion is not available + - CSS property name completion is not available. * IMPORTANT option changes: - 'cdpath' and 'runtimepath' no longer treat ",," specially. Use "." instead. - 'incsearch', 'hlsearch', 'ignorecase', and 'smartcase' have - been replaced with 'incfind', 'hlfind', and 'findcase' + been replaced with 'incfind', 'hlfind', and 'findcase'. - 'extendedhinttags' is now a regexpmap rather than a string. - 'guioptions' default value has changed. From c507f63194792297b2f4ea7e6c522f84baee20e9 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 24 Dec 2010 20:38:23 -0500 Subject: [PATCH 3/3] Fix minor completion error, also allow quoting of commas in LIST command arguments. --HG-- extra : rebase_source : b05a7ea4c41e540adec38f34a8a60b3431bd87a1 --- common/content/commands.js | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/common/content/commands.js b/common/content/commands.js index f79584c7..c508757d 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -80,7 +80,7 @@ update(CommandOption, { * E.g. "foo,bar" * @final */ - LIST: ArgType("list", function (arg) arg && arg.split(/\s*,\s*/)) + LIST: ArgType("list", function (arg, quoted) Option.splitList(quoted)) }); /** @@ -748,7 +748,10 @@ const Commands = Module("commands", { */ parseArgs: function (str, params) { try { - function getNextArg(str) { + function getNextArg(str, _keepQuotes) { + if (arguments.length < 2) + _keepQuotes = keepQuotes; + if (str.substr(0, 2) === "<<" && hereDoc) { let arg = /^<<(\S*)/.exec(str)[1]; let count = arg.length + 2; @@ -756,7 +759,7 @@ const Commands = Module("commands", { return [count, "", ""]; return [count, io.readHeredoc(arg), ""]; } - let [count, arg, quote] = Commands.parseArg(str, null, keepQuotes); + let [count, arg, quote] = Commands.parseArg(str, null, _keepQuotes); if (quote == "\\" && !complete) return [, , , "Trailing \\"]; if (quote && !complete) @@ -782,7 +785,7 @@ const Commands = Module("commands", { var invalid = false; // FIXME: best way to specify these requirements? var onlyArgumentsRemaining = allowUnknownOptions || options.length == 0; // after a -- has been found - var arg = null; + var arg = null, quoted = null; var count = 0; // the length of the argument var i = 0; var completeOpts; @@ -845,12 +848,14 @@ const Commands = Module("commands", { for (let [, optname] in Iterator(opt.names)) { if (sub.indexOf(optname) == 0) { invalid = false; + quoted = null; arg = null; quote = null; count = 0; let sep = sub[optname.length]; if (sep == "=" || /\s/.test(sep) && opt.type != CommandOption.NOARG) { - [count, arg, quote, error] = getNextArg(sub.substr(optname.length + 1)); + [count, quoted, quote, error] = getNextArg(sub.substr(optname.length + 1), true); + arg = Option.dequote(quoted); dactyl.assert(!error, error); // if we add the argument to an option after a space, it MUST not be empty @@ -879,7 +884,7 @@ const Commands = Module("commands", { if (!complete || arg != null) { if (opt.type) { let orig = arg; - arg = opt.type.parse(arg); + arg = opt.type.parse(arg, quoted); if (complete && isArray(arg)) { args.completeFilter = arg[arg.length - 1]; @@ -896,7 +901,7 @@ const Commands = Module("commands", { // we have a validator function if (typeof opt.validator == "function") { - if (opt.validator.call(this, arg) == false) { + if (opt.validator.call(this, arg, quoted) == false) { fail("Invalid argument for option: " + optname); if (complete) // Always true. complete.highlight(args.completeStart, count - 1, "SPELLCHECK"); @@ -904,11 +909,12 @@ const Commands = Module("commands", { } } - // option allowed multiple times - if (opt.multiple) - args[opt.names[0]] = (args[opt.names[0]] || []).concat(arg); - else - args[opt.names[0]] = opt.type == CommandOption.NOARG || arg; + if (arg != null || opt.type == CommandOption.NOARG) + // option allowed multiple times + if (opt.multiple) + args[opt.names[0]] = (args[opt.names[0]] || []).concat(arg); + else + args[opt.names[0]] = opt.type == CommandOption.NOARG || arg; i += optname.length + count; if (i == str.length)