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

Lex Trotman elextr at xxxxx
Fri Oct 22 09:54:58 UTC 2010


On 22 October 2010 19:20, Eugene Arshinov <earshinov at gmail.com> wrote:
> 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 :)

I'd leave everything as is.  There is already a checkbox to turn
on/off the "strip trailing blank lines" addon and one to turn on/off
the "end in EOL' option.  If a user turns on two options that do
opposite things well ... the only real confusion is that the options
are so far apart, but changing that is IMO too much work for the
benefit.

Cheers
Lex

>
> Best regards,
> Eugene.
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>



More information about the Devel mailing list