branch : pmacs2
This commit is contained in:
moculus 2008-05-19 05:53:31 +00:00
parent e0e4ada07c
commit aa2eb9e9fb
1 changed files with 6 additions and 12 deletions

View File

@ -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!