Hi all.
Everybody knows that Geany has menu item "Document > Strip trailing spaces" and option to do it automatically when a document is saved. My proposal is another command, something like "Strip trailing blank lines", to remove blank lines in the end of file (as they are absolutely useless there).
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.
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.