1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 10:27:58 +01:00

only call build_longest_common_substring() for :sidebar completion if a

completion filter is passed
This commit is contained in:
Doug Kearns
2007-09-18 16:20:18 +00:00
parent 6cbfc14b28
commit 43d86dc88b

View File

@@ -467,9 +467,16 @@ vimperator.completion = (function() // {{{
var nodes = [];
for (var i = 0; i < menu.childNodes.length; i++)
nodes.push([[menu.childNodes[i].label], ""]);
nodes.push([menu.childNodes[i].label, ""]);
return build_longest_starting_substring(nodes, filter);
if (!filter)
return nodes;
var mapped = nodes.map(function($_) {
return [[$_[0]], $_[1]];
});
return build_longest_common_substring(mapped, filter);
}, //}}}
exTabCompletion: function(str) //{{{