From 99202371c7784d346cf43a4c25c64bb6d7630f10 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 10 Jul 2013 02:13:25 -0400 Subject: invert the sense of the package message too --- lib/Reply/Plugin/Autocomplete/Functions.pm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib/Reply/Plugin/Autocomplete') diff --git a/lib/Reply/Plugin/Autocomplete/Functions.pm b/lib/Reply/Plugin/Autocomplete/Functions.pm index 233ec4d..257cacf 100644 --- a/lib/Reply/Plugin/Autocomplete/Functions.pm +++ b/lib/Reply/Plugin/Autocomplete/Functions.pm @@ -28,6 +28,8 @@ sub tab_handler { my ($before, $fragment) = $line =~ /(.*?)(${module_name_rx}(::)?)$/; return unless $fragment; + my $current_package = ($self->publish('package'))[-1]; + my ($package, $func); if ($fragment =~ /:/) { ($package, $func) = ($fragment =~ /^(.+:)(\w*)$/); @@ -35,20 +37,14 @@ sub tab_handler { $package =~ s/:{1,2}$//; } else { - $package = $self->{'package'}; + $package = $current_package; $func = $fragment; } return - map { $package eq $self->{'package'} ? $_ : "$package\::$_" } + map { $package eq $current_package ? $_ : "$package\::$_" } grep { $func ? /^\Q$func/ : 1 } 'Package::Stash'->new($package)->list_all_symbols('CODE'); } -sub package { - my $self = shift; - my ($pkg) = @_; - $self->{'package'} = $pkg; -} - 1; -- cgit v1.2.3-54-g00ecf