diff --git a/content/completion.js b/content/completion.js index d5ee30bf..b98c4282 100644 --- a/content/completion.js +++ b/content/completion.js @@ -30,7 +30,6 @@ the terms of any one of the MPL, the GPL or the LGPL. const EVAL_TMP = "__liberator_eval_tmp"; function __eval(__liberator_eval_arg, __liberator_eval_tmp) { - liberator.dump({__liberator_eval_tmp: __liberator_eval_tmp, __liberator_eval_arg: __liberator_eval_arg}) return window.eval(__liberator_eval_arg); } @@ -137,6 +136,8 @@ function Completion() //{{{ if (!(objects instanceof Array)) objects = [objects]; + completion.filterMap = [null, function (v) template.highlight(v, true)]; + if (cacheFilter.js === cacheKey) return cacheResults.js; cacheFilter.js = cacheKey; @@ -152,7 +153,7 @@ function Completion() //{{{ obj = obj.wrappedJSObject; for (let [k, v] in this.iter(obj)) - compl.push([k, template.highlight(v, true)]); + compl.push([k, v]); } return cacheResults.js = compl; } @@ -851,6 +852,7 @@ function Completion() //{{{ // provides completions for ex commands, including their arguments ex: function ex(str) { + this.filterMap = null; this.filterString = ""; this.parenMatch = null; substrings = []; diff --git a/content/ui.js b/content/ui.js index e7865887..433b1f35 100644 --- a/content/ui.js +++ b/content/ui.js @@ -1281,6 +1281,13 @@ function ItemList(id) //{{{ // TODO: temporary, to be changed/removed function createRow([b, c, a], dom) { + /* Kludge until we have completion contexts. */ + let map = completion.filterMap; + if (map) + { + b = map[0] ? map[0](b) : b; + c = map[1] ? map[1](c) : c; + } /* Obviously, ItemList shouldn't know or care about this. */ let filter = completion.filterString; if (filter)