[Bast-commits] r4398 - trunk/Devel-REPL/lib/Devel/REPL/Plugin/CompletionDriver

Sartak at dev.catalyst.perl.org Sartak at dev.catalyst.perl.org
Sun May 25 18:13:52 BST 2008


Author: Sartak
Date: 2008-05-25 18:13:51 +0100 (Sun, 25 May 2008)
New Revision: 4398

Modified:
   trunk/Devel-REPL/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm
Log:
If we complete to a subdirectory, add the final ::


Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm	2008-05-25 17:09:23 UTC (rev 4397)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm	2008-05-25 17:13:51 UTC (rev 4398)
@@ -30,14 +30,14 @@
   # 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 @@
     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;
     }
   }




More information about the Bast-commits mailing list