On So, 27 Apr 2014, cs86661 wrote:

> when I set ~/.viminfo to be symbolic link to /tmp/.viminfo, then close vim.
> The symbolic link will be replaced with an reqular .viminfo file ?
> So I can't simply use symbolic link on ~/.viminfo :(
> 
> reproduce:
> cd
> mv .viminfo /tmp/
> ln -s /tmp/.viminfo .viminfo
> file .viminfo (.viminfo: symbolic link to `/tmp/.viminfo')
> vi (then close it)
> file .viminfo (.viminfo: UTF-8 Unicode text)

I think, this patch does it:

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1771,6 +1771,16 @@ write_viminfo(file, forceit)
     fname = viminfo_filename(file);    /* may set to default if NULL */
     if (fname == NULL)
        return;
+#ifdef HAVE_READLINK
+    {
+       char_u  buf[MAXPATHL];
+       if (resolve_symlink(fname, buf) == OK)
+       {
+           vim_free(fname);
+           fname = vim_strsave(buf);
+       }
+    }
+#endif
 
     fp_in = mch_fopen((char *)fname, READBIN);
     if (fp_in == NULL)


Best,
Christian
-- 
Beurteile einen Menschen lieber nach seinen Handlungen als nach seinen
Worten; denn viele handeln schlecht und sprechen vortrefflich.
                -- Matthias Claudius

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui