Padre usability improvements

tsee on 2009-05-11T18:35:13

On the week-end, I finally implemented a few simple usability improvements for Padre, the Perl IDE.

With the recently released version 0.35, Padre supports a context (right click) menu that's actually context sensitive! (No shit!) If you right-click on a variable, Padre will offer additional options in the context menu that let you jump to the declaration of the variable or replace all occurrences of a lexical(!) variable.

Additionally, we stole a nice feature from Eclipse/Perl: If you hold Ctrl while left-clicking on a variable or subroutine name, the focus will jump to the respective definition. All this only works in the current file, unfortunately, but eventually, this will be a project-wide feature.

Today, a ticket in the bug tracker from Peter Makholm prompted me to implement an API for plugin authors. Your plugin can now provide different context menus depending on the document type, code at the cursor, additional modifier keys, or moon phase.

Update: Here's a simple example that you can copy&paste to your plugin to extend the context menu with a simple item

sub event_on_context_menu { my ($self, $doc, $editor, $menu, $event) = @_; $menu->AppendSeparator(); Wx::Event::EVT_MENU( $editor, $menu->Append( -1, Wx::gettext("Fun") ), sub { warn "FUN!" }, ); return(); }

Cheers,
Steffen