diff --git a/common/content/completion.js b/common/content/completion.js index cc9d6bf1..8b6288c4 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -643,7 +643,7 @@ var CompletionContext = Class("CompletionContext", { * interpreted as a method to access on *self*. */ fork: function fork(name, offset, self, completer) { - if (typeof completer == "string") + if (isString(completer)) completer = self[completer]; let context = CompletionContext(this, name, offset); if (this.contextList.indexOf(context) < 0) @@ -654,7 +654,9 @@ var CompletionContext = Class("CompletionContext", { else if (completer) { let res = completer.apply(self || this, [context].concat(Array.slice(arguments, fork.length))); if (res && !isArray(res) && !isArray(res.__proto__)) - return [k for (k in res)]; + res = [k for (k in res)]; + if (res) + context.completions = res; return res; } if (completer) diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm index 54311f6a..abf12c39 100644 --- a/common/modules/highlight.jsm +++ b/common/modules/highlight.jsm @@ -314,11 +314,12 @@ var Highlights = Module("Highlight", { if (!modify) modules.commandline.commandOutput( - template.tabular(["Key", "Sample", "CSS"], + template.tabular(["Key", "Sample", "Link", "CSS"], ["padding: 0 1em 0 0; vertical-align: top", "text-align: center"], ([h.class, XXX, + template.map(h.extends, template.highlight), template.highlightRegexp(h.value, /\b[-\w]+(?=:)/g)] for (h in highlight) if (!key || h.class.indexOf(key) > -1)))); @@ -353,7 +354,15 @@ var Highlights = Module("Highlight", { names: ["-link", "-l"], description: "Links this group to another", type: CommandOption.LIST, - completer: function (context, args) completion.highlightGroup(context) + completer: function (context, args) { + let group = args[0] && highlight.get(args[0]); + if (group) + context.fork("extra", 0, this, function (context) [ + [String(group.extends), "Current Value"], + [String(group.defaultExtends) || "", "Default Value"] + ]); + context.fork("groups", 0, completion, "highlightGroup"); + } } ], serialize: function () [