use namespace::clean -except => [ 'meta' ];
use Lexical::Persistence;
+with 'Devel::REPL::Plugin::FindVariable';
+
has 'lexical_environment' => (
isa => 'Lexical::Persistence',
is => 'rw',
return $self->$orig($wrapped, @rest);
};
+around 'find_variable' => sub {
+ my $orig = shift;
+ my ($self, $name) = @_;
+ my $variable = $self->lexical_environment->get_context('_')->{$name};
+ return \$variable if $variable;
+ return $orig->(@_);
+};
+
1;