From: Sartak Date: Sun, 25 May 2008 20:50:57 +0000 (+0000) Subject: Avoid completing keywords on $foo-> ... X-Git-Tag: v1.003015~104 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=873d8203272a4fc329d5ec1f17d52f67a2993ebb;p=p5sagit%2FDevel-REPL.git Avoid completing keywords on $foo-> ... git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@4405 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/Keywords.pm b/lib/Devel/REPL/Plugin/CompletionDriver/Keywords.pm index 55d5240..a897eca 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/Keywords.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/Keywords.pm @@ -12,6 +12,12 @@ around complete => sub { return $orig->(@_) unless $last->isa('PPI::Token::Word'); + # don't complete keywords on foo->method + return $orig->(@_) + if $last->sprevious_sibling + && $last->sprevious_sibling->isa('PPI::Token::Operator') + && $last->sprevious_sibling->content eq '->'; + my $re = qr/^\Q$last/; return $orig->(@_),