1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 02:44:23 +01:00

Add :command -javascript and CommandOption#default.

This commit is contained in:
Kris Maglione
2010-10-17 19:33:39 -04:00
parent 699b487ab2
commit a2f6b13a10
4 changed files with 105 additions and 75 deletions

View File

@@ -232,11 +232,8 @@ const Abbreviations = Module("abbreviations", {
dactyl.assert(lhs != null, "E474: Invalid argument");
if (rhs) {
if (args["-javascript"]) {
let expr = rhs;
rhs = dactyl.userFunc("editor", expr);
rhs.toString = function () expr;
}
if (args["-javascript"])
rhs = Command.bindMacro({ literalArg: rhs }, "-javascript", ["editor"]);
abbreviations.add(modes, lhs, rhs);
}
else {
@@ -258,7 +255,8 @@ const Abbreviations = Module("abbreviations", {
return completion.javascript(context);
},
literal: 0,
serial: function () [ {
serialize: function () [
{
command: this.name,
arguments: [abbr.lhs],
literalArg: abbr.rhs,