From aa2eb9e9fb9a68cdbc2400c19513820988078e20 Mon Sep 17 00:00:00 2001 From: moculus Date: Mon, 19 May 2008 05:53:31 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- tools/iperl | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tools/iperl b/tools/iperl index 210c798..016bc51 100755 --- a/tools/iperl +++ b/tools/iperl @@ -153,6 +153,12 @@ sub complete { my $sigil = $1; my $name = $2; my $pre = substr($line, 0, $x1); + + if(length($line) == $x1 && $pre =~ m/^[ \t]*$/) { + # hack to handle the case where we really do want a tab + return ("\t"); + } + if($pre =~ m/(\$(?:[a-zA-Z_][a-zA-Z0-9_]*::)*[a-zA-Z_][a-zA-Z0-9_]*)->$/) { # ref dereference my($obj, $reftype, $package) = resolve_ref($1); @@ -279,18 +285,6 @@ sub main { $attribs->{special_prefixes} = '$@%*&'; $attribs->{completion_function} = \&complete; $attribs->{completion_append_character} = ''; - my $func = sub { - my ($count, $key) = @_; - print STDERR "\n$count $key\n"; - my $line = substr($term->{line_buffer}, 0, $term->{point}); - if($line =~ m/^[ \t]*$/) { - $term->insert_text("\t"); - } else { - $term->call_function('complete', $count, $key); - #XYZ this is not the "normal" completion handler - } - }; - #$term->add_defun("erik-func", $func, ord("\t")); } # the mighty read-exec-print loop!