[Geany-devel] Writing a plugin, not sure what to do with it

Lex Trotman elextr at xxxxx
Tue Nov 15 23:45:00 UTC 2011


On Wed, Nov 16, 2011 at 8:29 AM, Meyer <3m.meyer at gmail.com> wrote:
> Hi all,
>
> I was looking for some programming to do recently and found this feature
> request:
> https://sourceforge.net/tracker/?func=detail&aid=3383201&group_id=153444&atid=787794
> .  I tried writing a plugin which implements the feature, and it seems to
> work, but now I'm not sure what to do with it now.  I've pasted the code
> here: http://pastebin.com/549Dazj0.  My main concerns are that it seems very
> hack-ish, and seems too simple to be a full plugin.
>
> Any advice regarding the code, what to do with it, etc. would be much
> appreciated.

Hi,

Nice simple plugin, but very fixed in operation, I have a couple of suggestions.

1. Use keybindings rather than the editor notify. This lets you catch
the key before it is inserted in Scintilla and allows the user to set
the trigger keycode (for me the actual characters would not be
appropriate, but <ctrl><shift>char would be, but different users would
have different use-cases).  See for eg addons plugin for how to use
keybindings.
2. Group the changes you make into one undo group, see the scintilla docs.
3. Add a preferences dialog to allow the opening and the respective
closing character(s) to be set for each trigger keycode.  It would of
course default to your current pairs but would allow updating for
other languages and multi character sequences.  See again for eg
addons.
4. Have 1 and 3 allow up to say eight codes/pairs to be defined.

The plugins infrastructure is about to get moved to Github and some
new processes are being defined, see
http://news.gmane.org/find-root.php?message_id=%3c4EC29977.1030802%40frank.uvena.de%3e
so keep an eye on that thread and you can be the first new plugin
using the new process :)

Cheers
Lex

>
> Thanks,
> Alex
>
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
>



More information about the Devel mailing list