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.