X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FCompletionDriver%2FINC.pm;h=0daf803ab5ec3adf0f270b90219802eb8fa66a70;hp=ace936fa4e0775289c141099f4fd189f5ec12c6e;hb=32d646c7c20ff26e8b0ae31b329fafb7094f6db7;hpb=30b459d4fbeb6f2406a3013c7cbcc46a6d0ccf0d diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm b/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm index ace936f..0daf803 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm @@ -4,6 +4,11 @@ use File::Next; use File::Spec; use namespace::clean -except => [ 'meta' ]; +sub BEFORE_PLUGIN { + my $self = shift; + $self->load_plugin('Completion'); +} + around complete => sub { my $orig = shift; my ($self, $text, $document) = @_; @@ -71,7 +76,7 @@ around complete => sub { my $add_recursively; $add_recursively = sub { my ($path, $iteration, @more) = @_; - opendir((my $dirhandle), $path); + opendir((my $dirhandle), $path) || return; for (grep { !$ignored{$_} } readdir $dirhandle) { my $match = $_;