summaryrefslogtreecommitdiff
path: root/common/content/editor.js
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2010-12-18 09:32:09 -0500
committerKris Maglione <maglione.k@gmail.com>2010-12-18 09:32:09 -0500
commit3f343d0d983f0e6c67a8515a4dcc6622531a7ae5 (patch)
treeaab8e0648c3839b0bae33dd70560f09212d0c9c0 /common/content/editor.js
parent3d6406751b5d5f36fa0d2e48fe5ee0eeadc55808 (diff)
downloadpentadactyl-3f343d0d983f0e6c67a8515a4dcc6622531a7ae5.tar.gz
Replace %format strings with our standard <macro> format strings in 'editor' and the like.
--HG-- extra : rebase_source : b5a658dd9f07e30f7e9cb589bb6efca8fd260a66
Diffstat (limited to 'common/content/editor.js')
-rw-r--r--common/content/editor.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/content/editor.js b/common/content/editor.js
index 61bcf06e..c79c89c5 100644
--- a/common/content/editor.js
+++ b/common/content/editor.js
@@ -242,7 +242,7 @@ const Editor = Module("editor", {
},
editFileExternally: function (path, line, column) {
- let args = options.get("editor").format({ f: path, l: line, c: column });
+ let args = options.get("editor").format({ file: path, line: line, column: column });
dactyl.assert(args.length >= 1, "No editor specified");
@@ -772,19 +772,19 @@ const Editor = Module("editor", {
options: function () {
options.add(["editor"],
"The external text editor",
- "string", "gvim -f +%l %f", {
+ "string", "gvim -f +<line> <file>", {
format: function (obj, value) {
let args = commands.parseArgs(value || this.value, { argCount: "*", allowUnknownOptions: true })
- .map(util.compileFormat).filter(function (fmt) fmt.valid(obj))
+ .map(util.compileMacro).filter(function (fmt) fmt.valid(obj))
.map(function (fmt) fmt(obj));
- if (obj["f"] && !this.has("f"))
- args.push(obj["f"]);
+ if (obj["file"] && !this.has("file"))
+ args.push(obj["file"]);
return args;
},
- has: function (key) set.has(util.compileFormat(this.value).seen, key),
+ has: function (key) set.has(util.compileMacro(this.value).seen, key),
validator: function (value) {
this.format({}, value);
- return Object.keys(util.compileFormat(value).seen).every(function (k) "cfl".indexOf(k) >= 0)
+ return Object.keys(util.compileMacro(value).seen).every(function (k) ["column", "file", "line"].indexOf(k) >= 0)
}
});