[Geany-devel] "Ensure new line on file end" inserts new line when file is empty

Eugene Arshinov earshinov at xxxxx
Fri Oct 22 08:20:32 UTC 2010


On Wed, 20 Oct 2010 12:42:52 +0100%
Nick Treleaven <nick.treleaven at btinternet.com> wrote:

> On Sat, 16 Oct 2010 22:37:29 +1100
> Lex Trotman <elextr at gmail.com> wrote:
> 
> > What I'm expressing badly is that if a file ends in a newline you
> > can consider that there is nothing after that, or you can consider
> > that it has an empty unterminated line after the newline. Similarly
> > an empty file has no lines or it has one unterminated empty line.
> > Geany takes the empty unterminated line view, since a new
> > "untitled" shows one line on screen.  But neither interpretation is
> > "right", it depends on what you are using the file for and what the
> > tools expect.
> > 
> > My argument is that, if someone (eg me) selects that I want my file
> > to end in newline (which is what the preference says) then thats
> > what it should do, irrespective of any interpretation or the length
> > of the file.
> 
> I agree.

Okay, let's forget this issue.  Anyway, how often do you edit empty
files? :)

Is it then acceptable that the part of the addons plugin that removes
trailing blank lines (written by me, btw) currently also removes the
newline Geany adds to empty file?  It may be a bit confusing (for a
hypothetical user who edits empty files).  Should it not remove the
newline, or provide a checkbox for that, or should we leave
everything as is?  I'd prefer the latter :)  

Best regards,
Eugene.



More information about the Devel mailing list