mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 08:38:00 +01:00
Last commit again, only right
This commit is contained in:
@@ -132,17 +132,15 @@ CompletionContext.prototype = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let substrings = lists.reduce(
|
let substrings = lists.reduce(
|
||||||
function (res, str) res.filter(
|
function (res, list) res.filter(
|
||||||
function (s) s.substr(0, Math.min(s.length, str.length))),
|
function (str) list.some(function (s) s.substr(0, str.length) == str)),
|
||||||
lists.pop());
|
lists.pop());
|
||||||
return util.Array.uniq(substrings);
|
return util.Array.uniq(substrings);
|
||||||
},
|
},
|
||||||
// Temporary
|
// Temporary
|
||||||
get longestAllSubstring()
|
get longestAllSubstring()
|
||||||
{
|
{
|
||||||
let substrings = this.allSubstrings;
|
return this.allSubstrings.reduce(function (a, b) a.length > b.length ? a : b, "");
|
||||||
// Find the longest match
|
|
||||||
return substrings.reduce(function (a, b) a.length > b.length ? a : b, "");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
get caret() this._caret - this.offset,
|
get caret() this._caret - this.offset,
|
||||||
|
|||||||
Reference in New Issue
Block a user