/usr/share/vile/perl/Vile.pm is in vile-common 9.8o-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | package Vile;
use strict;
sub mlreply_opts {
my ( $prompt, @origopts ) = @_;
my $i = 0;
my $word = $origopts[$i];
my $lastchar = 9;
my @opts = @origopts;
my $char;
print $prompt, $word;
while ( ( $char = Vile::keystroke() ) != 13 ) {
if ( $char == 9 ) {
@opts = grep( /^$word/, @origopts ) if ( $lastchar != 9 );
$word = $opts[ ++$i % ( $#opts + 1 ) ] if ( $#opts > -1 );
}
elsif ( $char == 8 ) {
$word = substr( $word, $[, length($word) - 1 ) if ( length $word );
$i = 0;
}
elsif ( $char == 21 ) {
$word = "";
$i = 0;
}
elsif ( $char == 27 ) {
undef $word;
last;
}
else {
$word = "" if ( $lastchar == 9 );
$word .= sprintf "%c", $char;
$i = 0;
}
print $prompt, $word;
$lastchar = $char;
}
return $word;
}
1;
__END__
=head1 NAME
Vile - perl library additions to Vile package
=head1 SYNOPSIS
use Vile;
Vile::mlreply_opts($prompt, @options)
=head1 DESCRIPTION
This module is supposed to contain additions to the Vile
package which are written in perl.
mlreply_opts PROMPT OPTIONS_LIST
Prompts the user with the given prompt and first of the
provided option list. At the prompt, the user can <TAB> his
way through all the possible options. He can also partially
fill in a response and <TAB> through matching options only.
When user presses <RET>, the user response is returned. If
the user aborts the query (via the use of the escape key),
an undef is returned.
Only backspace and kill-text keys work correctly for
editing the mini-buffer. Vile's mini-buffer editing is not
supported. Expand characters are also not recognized and
hence this command resembles mlreply_no_opts in that
respect despite the name.
=head1 CREDITS
Vile, Perl and Vile's Perl interface.
=head1 AUTHOR
Kuntal Daftary (daftary@cisco.com), 1998
=cut
|