No tab-completion for empty input

Old terminal takes about 1 minute to scroll the >9000 options...
This commit is contained in:
Juerd Waalboer 2019-11-08 03:44:19 +01:00
parent da043ba2df
commit c3b0b86c97

View file

@ -60,6 +60,7 @@ sub prompt {
my @matches;
$readline->Attribs->{completion_entry_function} = sub {
my ($word, $state) = @_;
return undef if $word eq "";
@matches = grep /^\Q$word\E/i, @$completions if $state == 0;
return shift @matches;
};