Padre-Plugin-Vi
view release on metacpan or search on metacpan
lib/Padre/Plugin/Vi/Editor.pm view on Meta::CPAN
$self->{editor}->ReplaceTarget('');
}
sub undo {
my ( $self, $count ) = @_;
$self->{editor}->Undo;
}
sub paste_after {
my ( $self, $count ) = @_;
my $text = Padre::Wx::Editor::get_text_from_clipboard();
if ( $text =~ /\n/ ) {
my $line = $self->{editor}->GetCurrentLine;
my $start = $self->{editor}->PositionFromLine( $line + 1 );
$self->{editor}->GotoPos($start);
}
$self->{editor}->Paste;
}
sub paste_before {
my ( $self, $count ) = @_;
my $text = Padre::Wx::Editor::get_text_from_clipboard();
if ( $text =~ /\n/ ) {
my $line = $self->{editor}->GetCurrentLine;
my $start = $self->{editor}->PositionFromLine($line);
$self->{editor}->GotoPos($start);
} else {
my $pos = $self->{editor}->GetCurrentPos;
$self->{editor}->GotoPos( $pos - 1 );
}
$self->{editor}->Paste;
}
lib/Padre/Plugin/Vi/Editor.pm view on Meta::CPAN
sub delete_lines {
my ( $self, $count ) = @_;
$self->select_rows($count);
$self->{editor}->Cut;
}
sub delete_till_end_of_line {
my ( $self, $count ) = @_;
#$self->{editor}->DelLineRight; # would be nice, but it does not put the strin in the clipboard
$self->select_till_end_of_line;
$self->{editor}->Cut;
}
sub yank_till_end_of_line {
my ( $self, $count ) = @_;
$self->select_till_end_of_line;
$self->{editor}->Copy;
( run in 0.572 second using v1.01-cache-2.11-cpan-84e82930d8c )