# 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 237 "lib/Term/ReadLine/Zoid/ViCommand.pm (autosplit into blib/lib/auto/Term/ReadLine/Zoid/ViCommand/_do_motion.al)"
sub _do_motion { # get and do a motion
	my ($self, $ignore, $cnt) = @_;
	my $key =  $self->key_name( $self->read_key );
	return $self->vi_reset if $key eq 'escape';
	return $self->bell
		unless grep {$_ eq $key} @vi_motions, $ignore, qw/left right up down home end/;
	my $vi_cmd = $$self{vi_command};
	#print STDERR "got argument motion: $key\n";
	my $re = 1;
	unless ($key eq $ignore) {
		my $pos = [@{$$self{pos}}]; # force copy
		$$self{vi_command} = (grep {$_ eq $key} qw/0 ^ $/) ? '' : $cnt ;
		$re = $self->do_key($key, $cnt);
		$$self{pos} = $pos unless $re; # reset pos if unsuccessfull
		$$self{pos}[0]++  if lc($key) eq 'e'
			and $$self{pos}[0] < length $$self{lines}[ $$self{pos}[1] ];
			# always one exception :S
	}
	$$self{vi_command} = $vi_cmd . $key;
	return $re;
}

# end of Term::ReadLine::Zoid::ViCommand::_do_motion
1;
