Because you have the option enabled. See `Edit->Preferences->Files->Ensure new line at end of file` for the global setting or `Project->Project Properties->Files->Ensure new line at file end` for the project-specific setting. Note that it's not an "extra" line per se, it's just a newline at the end of the file as is common with *nix/POSIX files and complained about when missing by Git.
Closed #2560.
I have a similar problem, but I have the option ticked off. Not sure why a newline is appended.
Either way I think this should not be the default that the editor is making changes to the content. The original content was x; geany appends a "\n" there means that geany modifies the original content. I don't think this should be done by default.
Note that editors such as vim or nano don't do this either. I don't think it should be the default. Right now this annoys me immensely, even if I am hitting this due to some bug (e. g. I have the check-box unchecked but a newline is still appended, so I can not really control geany's behaviour right now.)
It's ok as an option of course.
@rubyFeedback
Does not happen here if the pref is off.
Do you have a project open? Remember that it overrides the prefs setting as noted in the reply above.
The reply above notes that the line end at eof is required by POSIX and is complained about by git if missing, thats why its default, but its still an option, so if you don't want it turn it off.
github-comments@lists.geany.org