[Bast-commits] r4447 - in trunk/Devel-REPL: . lib/Devel/REPL/Plugin
Sartak at dev.catalyst.perl.org
Sartak at dev.catalyst.perl.org
Sat May 31 17:57:06 BST 2008
Author: Sartak
Date: 2008-05-31 17:57:05 +0100 (Sat, 31 May 2008)
New Revision: 4447
Modified:
trunk/Devel-REPL/
trunk/Devel-REPL/lib/Devel/REPL/Plugin/Completion.pm
Log:
r61346 at onn: sartak | 2008-05-31 12:56:47 -0400
Avoid using BEFORE_PLUGIN and AFTER_PLUGIN in Completion. it does not play well with role-role composition
Property changes on: trunk/Devel-REPL
___________________________________________________________________
Name: svk:merge
- 08e7d58d-de06-4458-8c15-335e402ab116:/local/Devel-REPL:61342
6d2a1d83-d666-409f-9dbf-d3bfcf4e9009:/local/bast/broken_internets/Devel-REPL:80567
+ 08e7d58d-de06-4458-8c15-335e402ab116:/local/Devel-REPL:61346
6d2a1d83-d666-409f-9dbf-d3bfcf4e9009:/local/bast/broken_internets/Devel-REPL:80567
Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/Completion.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/Completion.pm 2008-05-31 16:23:06 UTC (rev 4446)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/Completion.pm 2008-05-31 16:57:05 UTC (rev 4447)
@@ -24,24 +24,22 @@
default => 0,
);
-sub BEFORE_PLUGIN {
+before 'read' => sub {
my ($self) = @_;
+ unless ($self->term->isa("Term::ReadLine::Gnu") and !$self->no_term_class_warning) {
+ warn "Term::ReadLine::Gnu is required for the Completion plugin to work";
+ $self->no_term_class_warning(1);
+ }
+
my $weakself = $self;
weaken($weakself);
$self->term->Attribs->{attempted_completion_function} = sub {
$weakself->_completion(@_);
};
-}
+};
-sub AFTER_PLUGIN {
- my ($self) = @_;
-
- warn "Term::ReadLine::Gnu is required for the Completion plugin to work"
- unless $self->term->isa("Term::ReadLine::Gnu") and !$self->no_term_class_warning;
-}
-
sub _completion {
my ($self, $text, $line, $start, $end) = @_;
More information about the Bast-commits
mailing list