Hi Linda! On So, 13 Jul 2014, Linda A. Walsh wrote:
> John Little wrote: > >On Sunday, July 13, 2014 6:56:20 PM UTC+12, Linda A. Walsh wrote: > >>Where is it written that the last line of a file needs a uselss linefeed? > > > >POSIX definition of a text file is a file that contains characters organized > >into zero or more lines: > >http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_397 > > > >A line is defined to have a newline: > >http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 > > > >Text files with incomplete last lines have problems with lots of tools, like > >the diff programmes used by version control systems. If you are not using a > >VCS like mercurial or git, I suggest you look into it, they're a very good > >idea. > > > >Regards, John Littl > I appreciate the reference, as the standard says text files may > contain 0 or more lines > and that a line cannot contain NUL characters and none can exceed > LINE_MAX bytes > in LENGTH including a NL **[if one is present]**. (bracketed text, mine). > > > It does not say that a text file may not contain text characters at > the end of > the file. It infers that such would NOT be a line. Vim converts those > characters into a line -- and would be *creating* > lines in files where previously there were none. > > This is an error in Vim under POSIX, as you note. Vim is not POSIX > compatible, > but that is really moot to the idea of allowing a choice. > > Vim embodies having, not only a choice other than POSIX, but a multitude > of choices. If Vim were to delete all non-POSIX features, there would > only be "vi": i.e. -- there would be no Vim. > > Are you saying Vim should not exist? I am not sure, if being silly helps in getting anybody convinced that Vim's behaviour should change. In fact, I don't see your problem. Just set the required options and be done. Best, Christian -- Wenn ein Mensch ein Loch sieht, hat er das Bestreben, es auszufüllen. Dabei fällt er meist hinein. -- -- You received this message from the "vim_use" 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_use" 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.
