Opened 5 years ago

Last modified 5 years ago

#425 new enhancement

inserting a string at the current position

Reported by: szabgab Owned by:
Priority: major Milestone:
Component: editor Version: 0.38
Keywords: Cc:

Description

I have a sub like this in My plugin that allows me to insert arbitrary text at the current position of the current page.

sub insert {
        my $text = shift;

        my $main = Padre->ide->wx->main;
        my $doc = $main->current->document;
        my $editor = $doc->editor;
        $editor->InsertText($editor->GetCurrentPos(), $text);
        return;
}

1) how could I simplify this?
2) I'd like to offer this as a simple method for the plugin writers where shall I put it and how shall I call it?

Change History (1)

comment:1 Changed 5 years ago by szabgab

  • Type changed from defect to enhancement
Note: See TracTickets for help on using tickets.