In Preferences -> Files there is an option "Ensure new line at file end" that, as far as I understand, is supposed to enable/disable adding of a new line in the end of the file if the last line is not empty. However, even when this option is disabled (unticked), if the last line is not empty and you save the file, Geany adds a new line after the last one.
I noticed that there is no new line at the end of the file if the option ```Ensure new line at file end``` is disabled and the file is closed. I checked that with a different editor (not with Geany). Only on re-opening the file in Geany the new line appears in the editor window - but it's not in the file. Not sure if that helps.
@Kzer-Za is it possible you're using a Project with `Ensure new line at file end` ticked in the Project Properties dialog?
This is a recorded message, please always provide the version of Geany, Glib and GTK (see lines near the top of Help->Debug Messages) and the operating system and version you are using.
WFM Geany 1.36 (git >= 4bceddb4), en_AU.UTF-8 GTK 3.22.30, GLib 2.56.4 Linux Mint,
- create new file add "foo", there is no return at end of line - ensure that the specified preference is unticked - save file - close file - open file, there is no return on end of file
Note if you add a return Geany will not remove it and as @codebrainz noted there is a project specific version of the option which overrides the general option.
@codebrainz, @elextr, thanks, I didn't know that this option was also in Project Properties and it overrode the one in "general" preferences.
Sorry about the insufficient information, usually I try to provide more detailed info, I guess I was getting sleepy. Anyways, the "issue" was with me not knowing about the project properties, so I guess I should close it now.
Closed #2310.
It's a common trap, see: #1363, #1611, #1881, etc.
@Kzer-Za is it possible you're using a Project with `Ensure new line at file end` ticked in the Project Properties dialog?
@codebrainz Thank you for pointing that out. That was my problem as well.
github-comments@lists.geany.org