On Sat, Oct 7, 2017 at 3:55 AM, Jonas Thiem <[email protected]> wrote:
> However, this assumes \r\n is similar to \n semantically an end of line
> character, while actually the common interpretation of Windows seems to be
> it always starts a new line. So I don't think that view makes a lot of sense
> for DOS line breaks.. but I suppose it is hard to fix this with such an
> underlying assumption baked in.

Well, it all comes from a difference of point of view. To Vim, an
end-of-line character or sequence "ends" a line and even the last line
in a file is "improperly constructed" if it lacks one. To some Windows
programs, the same sequence "separates" lines and the last line in a
file doesn't need one — indeed, if a file ends in such a sequence,
they assume there is an empty line at the end. Such a supposed "empty
line" is usually harmless and AFAIK it never makes the DOS/Windows
editor, compiler, etc. issue any message so I go with Vim in this
respect and everyone is happy, except maybe the nitpicking Windows
_user_ who finds that two extra bytes ("extra" from his point of view)
at the end of a long file are too much.

The Vim convention isn't groundless: if you concatenate two or more
files, and each of them ends in an end-of-line, there will still be a
line break between successive component files. If one of them (other
than the last) lacks a proper EOL at the end, the "cat" (concatenate)
Unix program, or (I suppose) the "copy a.txt+b.txt+c.txt abc.txt"
Dos/Windows operation will "run it in" with the first line of the next
file as a single line. "Programs don't think, they do exactly what you
tell them to do, even if it isn't what you meant."

Best regards,
Tony.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui