home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2005 December (Special)
/
PCWorld_2005-12_Special_cd.bin
/
Bezpecnost
/
lsti
/
lsti.exe
/
framework-2.5.exe
/
vi_increment.al
< prev
next >
Wrap
Text File
|
2005-04-27
|
803b
|
22 lines
# NOTE: Derived from lib/Term/ReadLine/Zoid/ViCommand.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Term::ReadLine::Zoid::ViCommand;
#line 933 "lib/Term/ReadLine/Zoid/ViCommand.pm (autosplit into blib/lib/auto/Term/ReadLine/Zoid/ViCommand/vi_increment.al)"
sub vi_increment {
my ($self, $key) = @_;
my ($l, $x) = ( $$self{lines}[ $$self{pos}[1] ], $$self{pos}[0] );
my $add = ($key eq 'ctrl_A') ? 1 : -1;
return $self->bell unless $l =~ /^(.{0,$x}?)(0x(?i:[a-f\d])+|\d+)(.*?)$/; # FIXME triple check this regexp
my ($pre, $int, $post) = ($1, $2, $3);
$int = ($int =~ /^0x/) ? sprintf("0x%x", hex($int) + $add) : ($int + $add) ;
$$self{lines}[ $$self{pos}[1] ] = $pre . $int . $post;
}
# end of Term::ReadLine::Zoid::ViCommand::vi_increment
1;