1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 10:47:59 +01:00

Last commit again, only right

This commit is contained in:
Kris Maglione
2008-11-28 09:43:17 +00:00
parent 419ecace82
commit bca9a9e26f

View File

@@ -132,17 +132,15 @@ CompletionContext.prototype = {
});
let substrings = lists.reduce(
function (res, str) res.filter(
function (s) s.substr(0, Math.min(s.length, str.length))),
function (res, list) res.filter(
function (str) list.some(function (s) s.substr(0, str.length) == str)),
lists.pop());
return util.Array.uniq(substrings);
},
// Temporary
get longestAllSubstring()
{
let substrings = this.allSubstrings;
// Find the longest match
return substrings.reduce(function (a, b) a.length > b.length ? a : b, "");
return this.allSubstrings.reduce(function (a, b) a.length > b.length ? a : b, "");
},
get caret() this._caret - this.offset,