[Geany-Users] geany blank files start with two lines

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Geany-Users] geany blank files start with two lines

Daiyue Weng
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.

See the screen shot


_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany-Users] geany blank files start with two lines

Colomban Wendling
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
_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Geany-Users] geany blank files start with two lines

Lex Trotman
In reply to this post by Daiyue Weng
Unselect Menu->edit->preferences->files->ensure new line at file end

Cheers
Lex

On 18 December 2015 at 23:18, Daiyue Weng <[hidden email]> wrote:

> 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.
>
> See the screen shot
>
> https://drive.google.com/file/d/0BzLdl9mTylfjaEk0NmhELUhTWjQ/view?usp=sharing
>
> cheers
>
> _______________________________________________
> Users mailing list
> [hidden email]
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>
_______________________________________________
Users mailing list
[hidden email]
https://lists.geany.org/cgi-bin/mailman/listinfo/users
Loading...