And fix "lei index" completion while we're at it.
sub _complete_import {
my ($lei, @argv) = @_;
- my $sto = $lei->_lei_store or return;
- my $lms = $sto->search->lms or return;
my $match_cb = $lei->complete_url_prepare(\@argv);
- map { $match_cb->($_) } $lms->folders;
+ my @m = map { $match_cb->($_) } $lei->url_folder_cache->keys;
+ my %f = map { $_ => 1 } @m;
+ my $sto = $lei->_lei_store;
+ if (my $lms = $sto ? $sto->search->lms : undef) {
+ @m = map { $match_cb->($_) } $lms->folders;
+ @f{@m} = @m;
+ }
+ keys %f;
}
no warnings 'once';
*$m = PublicInbox::LeiImport->can($m);
}
-*_complete_import = \&PublicInbox::LeiImport::_complete_import;
+*_complete_index = \&PublicInbox::LeiImport::_complete_import;
*ipc_atfork_child = \&PublicInbox::LeiInput::input_only_atfork_child;
*net_merge_all_done = \&PublicInbox::LeiInput::input_only_net_merge_all_done;