Am 20.02.2012 09:49, schrieb Emil Brink:
I saw that "Remove duplicate lines - simple?" item on the Plugin wishlist, and thought I'd have a go at it this weekend.
Nice ;)
The results are at https://github.com/unwind/geanyuniq, and I would love some feedback.
Without having a too deep look, just a few thought: * you should consider using PLUGIN_SET_TRANSLATABLE_INFO macro instead of PLUGIN_SET_INFO. Its allowing also to translated informatons inside geany's plugin manager * Why do you giving prev (l66) a fixed size? IIRC this will prevent lines to being checked in case of they are huger than 512 char (or e.g. ~128 real UTF32 chars)
There is a huge known issue: because I tried to be clever(TM) and install the menu item in a suitable place (rather than just at the bottom of the Tools menu), this will likely break for localized versions of Geany. Not good.
My idea on how to fix that is to make it customizable where to insert the menu, so the user can enter the properly localized text to search for. Other ideas? Is it "by design" that it's so hard for plugins to add commands to arbitrary locations within Geany's menus? The GIMP does this differently, with an abstract "menu path" concept that makes it portable and easy to add items wherever.
At least as far as I know this just wasn't under discussion by now. Its current just some kind of a stack.
Ignoring the menu item issue, the command is by default bound to Shift+Control+D,
I'd remove default binding. E.g. I already have this one in another use.
and always runs over the entire document, ignoring (and actually removing) the selection. Does this make sense? Should it run only over the selection, if one is present?
As mentioned before: Yes.
It outputs a line of text to the Status window saying how many lines were deleted (if any were deleted), is that a good idea, or annoying/spammy?
I like that idea.
Are you thinking of adding it to geany-plugins project? ;)
Cheers, Frank