David Thompson <[EMAIL PROTECTED]> 写于 2006-11-15 14:56:15:
> I'm using 'patchmode=.orig' in my ~/.vimrc,
> when I edit a new file such as xxx that does
> not exist, then save that file, I also get a
> 0-byte file called xxx.orig. This 0-byte
> file seems rather pointless.
>
> To recreate,
>
> vim -u NONE xxx
> :set patchmode=.orig
> iHello World<Esc>
> :wq
>
> then 'ls -l' and it shows,
>
> -rw-r--r-- 1 davidt core 12 Nov 14 22:47 xxx
> -rw-r--r-- 1 davidt core 0 Nov 14 22:47 xxx.orig
>
> I don't understand why vim cannot avoid creation of
> the 0-byte xxx.orig upon first creation of xxx.
>
> IMHO, this is a bug. Anyone agree?
>
> My 'vim --version' output is,
>
> VIM - Vi IMproved 7.0 (2006 May 7, compiled Oct 24 2006 17:24:02)
> Included patches: 1-4, 6-26, 29-31, 33-44, 46-56, 58-64, 66-73, 75-91
> [snip]
>
> Regards,
>
> David
I can't see this to be a bug, Vim is doing exactly what it is told to and
everything is well documented.
see :help 'patchmode'
in options.txt line 4919:
If there was no file to be backed up, an empty file is
created.
HTH.
--
Sincerely, Pan, Shi Zhu. ext: 2606