diff --git a/common/content/abbreviations.js b/common/content/abbreviations.js index 2d97f7f0..0ddb625a 100644 --- a/common/content/abbreviations.js +++ b/common/content/abbreviations.js @@ -227,6 +227,10 @@ var Abbreviations = Module("abbreviations", { */), "x", params); }, + get allHives() contexts.allGroups.abbrevs, + + get userHives() this.allHives.filter(h => h !== this.builtin), + get: deprecated("group.abbrevs.get", { get: function get() this.user.closure.get }), set: deprecated("group.abbrevs.set", { get: function set() this.user.closure.set }), remove: deprecated("group.abbrevs.remove", { get: function remove() this.user.closure.remove }), @@ -257,7 +261,7 @@ var Abbreviations = Module("abbreviations", { * @optional */ list: function (modes, lhs, hives) { - let hives = hives || contexts.allGroups.abbrevs.filter(h => !h.empty); + let hives = (hives || this.userHives).filter(h => !h.empty); function abbrevs(hive) hive.merged.filter(ab => (ab.inModes(modes) && ab.lhs.indexOf(lhs) == 0)); @@ -341,18 +345,22 @@ var Abbreviations = Module("abbreviations", { description: "Expand this abbreviation by evaluating its right-hand-side as JavaScript" } ], - serialize: function () [ - { - command: this.name, - arguments: [abbr.lhs], - literalArg: abbr.rhs, - options: { - "-javascript": callable(abbr.rhs) ? null : undefined + serialize: function () array(abbreviations.userHives) + .filter(h => h.persist) + .map(hive => [ + { + command: this.name, + arguments: [abbr.lhs], + literalArg: abbr.rhs, + options: { + "-group": hive.name == "user" ? undefined : hive.name, + "-javascript": callable(abbr.rhs) ? null : undefined + } } - } - for ([, abbr] in Iterator(abbreviations.user.merged)) - if (abbr.modesEqual(modes)) - ] + for ([, abbr] in Iterator(hive.merged)) + if (abbr.modesEqual(modes)) + ]). + flatten().array }); commands.add([ch + "una[bbreviate]"], diff --git a/common/locale/en-US/repeat.xml b/common/locale/en-US/repeat.xml index f977e0cb..3aaaa4d9 100644 --- a/common/locale/en-US/repeat.xml +++ b/common/locale/en-US/repeat.xml @@ -284,12 +284,13 @@
In addition to its own JavaScript context, each script is executed
with its own default group into which
- its styles, mappings, commands, and autocommands are placed. This
- means that commands such as