"dong wang" <[EMAIL PROTECTED]> 写于 2006-12-11 18:10:03:
> I found a problem ( sorry , here i just call it problem ) when i edit
> a csv file.
> That is the vim don't display the last line as a seperate line when i
> do " set nu"
>
> For exmaple ,
> use Notepad.exe (or some other Editor) to create a file  , and do input :
>
> abc<CR>
> abc<CR>
>
> save the  file.
>
> After that , use vim to open the file and "set nu"
> Well , i found that , the vim just displays the line number as this
>
>  1 abc
>  2 abc
>
> which i thought it should be :
>
>  1 abc
>  2 abc
>  3
>
> Does this a problem ?
> Or i can use some option to control this?
>
>  Why did vim not display the last line number ?
>  in my option i thought the fine should have three line
>  but not just TWO line , Right ?

No, this is not a "problem". This is a "feature"... ;-)

Vi treat text files in "Unix" way. i.e. all lines should have a line break.

So if you want :

1 abc
2 abc
3

then the stream on disk should be something like:
abc<cr>abc<cr><cr>

If you have 3 lines you should have 3 <cr>s, if you had 2 <cr>s you will
got 2 lines. That's it.

Hope that helps.
--
Sincerely, Pan, Shi Zhu. ext: 2606

Reply via email to