[Geany-devel] Strip trailing blank lines (patch included)

Enrico Tröger enrico.troeger at xxxxx
Wed Aug 26 18:50:28 UTC 2009


On Wed, 26 Aug 2009 19:48:30 +0400, Eugene wrote:

Hey,

>I wrote new `editor_strip_trailing_newlines' function (see the
>attached patch). Currently I call it directly from
>`document_save_file' if `strip_trailing_spaces' setting is set. Of
>course, it's not how it should be. Maybe separate menu item and option
>should be added, like for trailing spaces. Alternative way is to
>combine those, i.e., rename "Strip trailing spaces" to "Remove
>excessive whitespace" :-) These all are usability issues, with which I
>don't like to deal. If any of the developers has an opinion upon
>those, I'll consider it and update the patch.

Hmm, I'm not sure that would be an often used feature but of course it
can be useful and you already wrote the code (and used it on the
modified files in your patch...I like to have two or three trailing
blank links at EOF :D).
Back to the topic, what about putting this into a plugin?

Either as a separate plugin which might be a bit overhead, or as part
of the addons plugin which aims to collect such small pieces of
additions or as a new (core) plugin into which we could move the
existing other both related features, too.

Just some thoughts. Opinions?


>P.S. My code leaves one trailing newline if `final_new_line' setting
>is set. Otherwise, it removes all trailing newlines. I believe it is
>right.

Me too. Sounds reasonable.

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20090826/fb1873b4/attachment.pgp>


More information about the Devel mailing list