Ticket #1168 (closed enhancement: fixed)
Allow plugins to hook into the on_save method
|Reported by:||szabgab||Owned by:|
Description (last modified by szabgab) (diff)
We discussed on IRC that it would be interesting to allow the Perl Tidy plugin to run on the current file on every save.
There were some discussion about pulling the plugin into core but IMHO this is an opportunity to see if we can enable the plugins to hook into the on_save method of Padre.
The plugin can have a method called on_save and it will be called on every save.
The plugin can have a method called padre_hooks that will
return a hash-ref. In that hash-ref we can have a key called on_save with the value being a sub-ref.
The latter makes the hooks system more extend-able and less likely interference with current methods of plugins.
If more than one plugin provides the same hooks we need to decide in which order they are called. I'd suggest to start with the abc order of the plugins.