From d23b43d963f30ae868a613d326a5ff10d55a2a10 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 10 Nov 2010 11:28:09 +1100 Subject: [PATCH] Return all abbreviations, by default, from the abbreviation completer. Fixes :command -complete=abbreviation --- common/content/abbreviations.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/content/abbreviations.js b/common/content/abbreviations.js index 0ca49cba..3caabab7 100644 --- a/common/content/abbreviations.js +++ b/common/content/abbreviations.js @@ -216,8 +216,9 @@ const Abbreviations = Module("abbreviations", { }, { completion: function () { completion.abbreviation = function abbreviation(context, modes) { - let abbrevs = abbreviations.merged.filter(function (abbr) abbr.inModes(modes)); - context.completions = [[abbr.lhs, abbr.rhs] for ([, abbr] in Iterator(abbrevs))]; + let fn = modes ? function (abbr) abbr.inModes(modes) : util.identity; + context.keys = { text: "lhs" , description: "rhs" }; + context.completions = abbreviations.merged.filter(fn); }; },