From: Sartak Date: Mon, 26 May 2008 03:47:44 +0000 (+0000) Subject: Tweaks to complete package names and variables X-Git-Tag: v1.003015~97 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=310ddf9f9d5d370f7b4aa89e7bbf4fd7f6a3814f;p=p5sagit%2FDevel-REPL.git Tweaks to complete package names and variables git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@4412 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/Globals.pm b/lib/Devel/REPL/Plugin/CompletionDriver/Globals.pm index 798ba51..98f3443 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/Globals.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/Globals.pm @@ -9,9 +9,10 @@ around complete => sub { my $last = $self->last_ppi_element($document); return $orig->(@_) - unless $last->isa('PPI::Token::Symbol'); + unless $last->isa('PPI::Token::Symbol') + || $last->isa('PPI::Token::Word'); - my $sigil = substr($last, 0, 1, ''); + my $sigil = $last =~ s/^[\$\@\%\&\*]// ? $1 : undef; my $re = qr/^\Q$last/; my @package_fragments = split qr/::|'/, $last;