Hi Bram,
On Tue, Jun 8, 2021 at 9:18 AM Bram Moolenaar <[email protected]> wrote:
>
>
> Yegappan wrote:
>
> > When developing tests for the memline.c file, I ran into a E315
> > ml_get error when trying to recover from a swap file on a Linux
> > system using the following function:
> >
> > func Test()
> > call delete('Xfile1')
> > call delete('Xfile2')
> > call delete('.Xfile1.swp')
> > call writefile([], 'Xfile1')
> > silent !ln -s Xfile1 Xfile2
> > edit Xfile2
> > preserve
> > let b = readblob('.Xfile1.swp')
> > %bw!
> > call writefile(['aaa', 'bbb', 'ccc'], 'Xfile1')
> > call writefile(b, '.Xfile1.swp')
> > recover Xfile1
> > endfunc
> > call Test()
> >
> > After calling this function, press Enter for the prompts, you will
> > see a series of E315 errors.
>
> I ran this in the src/testdir directory with "vim --clean". I got:
>
> "Xfile2" 0L, 0B
> File preserved
> 2 buffers wiped out
> Using swap file ".Xfile1.swp"
> Original file "~/vim/vim82/src/testdir/Xfile1"
> Recovery completed. You should check if everything is OK.
> (You might want to write out this file under another name
> and run diff with the original file to check for changes)
> You may want to delete the .swp file now.
> Note: process STILL RUNNING: 868546
>
>
> No ml_get errors. Something else needed?
>
Looks like the viminfo file needs some entries pointing to Xfile1
to reproduce this issue. The following commands reproduce the issue:
<place the above Test() function in a file called test.vim>
vim --clean -c 'set viminfofile=' -c 'call writefile(["aaa", "bbb",
"ccc"], "Xfile1")' -c 'edit Xfile1' -c 'normal 3Gyy' -c 'call
delete("Xfile1")' -c 'q'
vim --clean -c 'set viminfofile=' -c 'source test.vim' -c 'call Test()'
- Yegappan
--
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/CAAW7x7mHrx2_%2Bpb7Y-8e5of4Gcwp820%3DO2HDq9w%2Bcbmv6jUhKw%40mail.gmail.com.