From: Sartak Date: Sun, 25 May 2008 17:13:51 +0000 (+0000) Subject: If we complete to a subdirectory, add the final :: X-Git-Tag: v1.003015~111 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=commitdiff_plain;h=b0489a7cf229890de0c78c24489240fffc6bf60a If we complete to a subdirectory, add the final :: git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@4398 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm b/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm index d2996e3..6ea06d1 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm @@ -30,14 +30,14 @@ around complete => sub { # require "Module" if ($package->isa('PPI::Token::Quote')) { - $outsep = $insep = '/'; - $keep_extension = 1; + $outsep = $insep = '/'; + $keep_extension = 1; } elsif ($package =~ /'/) { - # the goofball is using the ancient ' package sep, we'll humor him - $outsep = q{'}; - $insep = "'|::"; + # the goofball is using the ancient ' package sep, we'll humor him + $outsep = q{'}; + $insep = "'|::"; } my @directories = split $insep, $package; @@ -61,7 +61,13 @@ around complete => sub { opendir((my $dirhandle), $path); for my $match (grep { $_ =~ $final_re } readdir $dirhandle) { - $match =~ s/\..*// unless $keep_extension; + if ($match =~ /\./) { + $match =~ s/\..*// unless $keep_extension; + } + # this is another subdirectory, so we're not done completing + else { + $match .= $outsep; + } push @found, join $outsep, @directories, $match; } }