diff --git a/common/content/commands.js b/common/content/commands.js index 4b7d99b4..83c04985 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -561,7 +561,7 @@ const Commands = Module("commands", { sourcing = sourcing || { file: "[Command Line]", line: 1 }; this.sourcing = update({}, sourcing); - args = update({ setFrom: this.sourcing.file }, args || {}); + args = update({}, args || {}); if (tokens) string = commands.replaceTokens(string, tokens); diff --git a/common/content/options.js b/common/content/options.js index 2bf4f6d5..f1dca9f4 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -892,13 +892,15 @@ const Options = Module("options", { if (opt.all) options.list(opt.onlyNonDefault, opt.scope); else { + XML.prettyPrinting = false; + XML.ignoreWhitespace = false; if (option.type == "boolean") var msg = (opt.optionValue ? " " : "no") + option.name; else msg = " " + option.name + "=" + opt.option.stringify(opt.optionValue); if (options["verbose"] > 0 && option.setFrom) - msg += "\n Last set from " + option.setFrom; + msg = <>{msg}
Last set from {template.sourceLink(option.setFrom)}; dactyl.echo({msg}); } @@ -918,7 +920,7 @@ const Options = Module("options", { } if (res) dactyl.echoerr(res); - option.setFrom = modifiers.setFrom || null; + option.setFrom = commands.getCaller(null); } } } diff --git a/common/modules/template.jsm b/common/modules/template.jsm index fcc3283e..3a1790a2 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -244,6 +244,24 @@ const Template = Module("Template", { // }, + sourceLink: function (frame) { + let url = (frame.filename || "unknown").replace(/.* -> /, ""); + function getPath(url) { + try { + return util.getFile(util.newURI(url)).path; + } + catch (e) { + return url; + } + } + + return { + getPath(url) + ":" + frame.lineNumber + } + }, + table: function table(title, data, indent) { let table = // @@ -289,14 +307,6 @@ const Template = Module("Template", { }, usage: function usage(iter) { - function getPath(url) { - try { - return util.getFile(util.newURI(url)).path; - } - catch (e) { - return url; - } - } // return { @@ -304,15 +314,10 @@ const Template = Module("Template", { )
{ let (name = item.name || item.names[0], frame = item.definedAt) - !frame ? name : /* Help... --Kris */ - let (url = (frame.filename || "unknown").replace(/.* -> /, "")) - <>{name}  - - Defined at { getPath(url) + ":" + frame.lineNumber } - - + !frame ? name : <> + {name}  + Defined at {template.sourceLink(frame)} + } {item.description}