Thursday, December 3, 2015

VIM shows line ending when there is no line ending on the last line of a file

Hi, today I discovered a strange issue that lead me to waste 2 hours of time, since I rely on vim but it seems I discovered a bug.

When working with files I usually put on end of line markers with the command : set list .
Today I had a file with the last line without a LF character but though I had enabled the line ending markers(with : set list) and put vim in binary mode, it kept sowing a dollar sign at the end of the last line, as if a line mark was there for real. Why vim shows an end of line when there is actually no end of line ?

Even opening with -b option I get the same result...

To simulate just try with a simple perl script to write a single character on a file:


open(FH, '>', 'file.txt');
print FH 'a';
close(FH);

you will notice that VIM will keep showing the end of line sign.

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

No comments:

Post a Comment