Hi,
Le 18/12/2015 14:18, Daiyue Weng a écrit :
Hi, I found that whenever I create and save a blank java files (e.g. click 'New' -> save 'untitled' as 'file_name.java'), the saved files always start with two blank lines. I am wondering how to make it only start with one line.
That's not actually 2 blank lines, it's a file with one single newline character (either NL (UNIX-ish), CR+NL (Windows-ish) or CR (Old MacOS-ish)). Line 1 you see is before the newline, and line 2 after. So there's actually one single sequence of "content + newline sequence", but is displayed with a second line so you can add stuff after the newline sequence.
By default Geany will ensure there's always at least one newline at the end of the files when it saves it, for various compatibility reasons, and because it's generally what people want (each line with something it in being terminated with a newline). You can disable this in the preferences under *Files -> Saving Files -> Ensure new line at file end*.
Regards, Colomban