Laurent Lyaudet wrote:
>
> Hi,
>
> I have found the following bug. When I open a file in Vim the last
> newline disappears.
> Hence it is impossible to see it is there and to remove it (suppress
> or backspace doesn't work).
> The problem occurs both with Linux '\n' and Windows '\r\n'.
>
> I join a sample text file with a '\r\n'
> testVim3.txt <https://github.com/vim/vim/files/39391/testVim3.txt>
> Another sample text file with a '\n'
> testVim5.txt <https://github.com/vim/vim/files/39392/testVim5.txt>
>
> The problem is quite serious for php files
> testVim.txt <https://github.com/vim/vim/files/39394/testVim.txt>
> since additional characters after "?>" are sent as HTML and you can
> get an error "Headers already sent" if you want to output something
> else that HTML.
>
> I had to compare the result in Nano, Notepad++ and hexdump to realize
> the problem was with Vim.
>
>
Suggested reading assignment:

  :help 'ff'
  :help 'ffs'
  :help -b

If I understand what you're saying correctly, you're complaining that
what vim recognizes as line separators (sometimes \r\n, othertimes \n)
don't visually appear.  Most people, myself included, would not want
those line separators showing up, either.  Visually quite distracting. 
The '\n's are there, even with binary mode (ie. vim -b), although binary
mode will ahow the '\r's as a ^M.  If I wanted to eliminate such a
newline, I'd join the lines (J, or :j, or :j!).  If I wanted more, I'd
insert more lines.

Perhaps you're complaining that ^M characters don't appear, for example,
with your testVIm3.txt or testVim.txt.  That's because Windows users'
line separator is ^M^J (or \r\n, if you prefer).  If you do:  :echo &ff 
you'll see that testVim.txt and testVim3.txt are being recognized as dos
files.

If you

  vim testVim3.txt
  :echo &ff   <-- you'll see its dos
  :set ff=unix  <-- line endings now converted to unix style (ie. no ^Ms
anymore)

Regards,
Chip Campbell

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui