Code Formatter - Only one new line at end of file
Brought to you by:
fabioz
Please change a bit behavior of "Add new line at the end of file?" to "One new line at end of file?". This should not only add a new line when there is none, but also if there is more than one, make it exactly one.
BTW. for example "git diff" by default shows these empty lines at the end of file in red color same as for trailing white-spaces at the end of line.
Just to note, this should be an additional option (i.e.: the add new line at end of file should remain there and an additional option should be added: trim lines at end of file) as we do not want to break the existing behavior as many people may rely on how it works now.
Now, this isn't really high in my priority list and should be pretty simple to do once you have the code in your machine... wouldn't you be interested in implementing and providing a patch for it?
If you are, take a look at: http://pydev.org/developers.html for getting the code and then changing:
https://github.com/aptana/Pydev/blob/development/plugins/org.python.pydev/src/org/python/pydev/editor/actions/PyFormatStd.java, search for formatStd.addNewLineAtEndOfFile and add the option you want (note that you'd also need to add a test case to https://github.com/aptana/Pydev/blob/development/plugins/org.python.pydev/tests/org/python/pydev/editor/actions/PyFormatStdTest.java and add the given preference).