Hirohito Higashi wrote:

> How to reproduce:
> - Symbolic link to ~/.vim
>   $ mkdir -p ~/sample/.vim/pack/dist/opt/bar/plugin/
>   $ ln -s ~/sample/.vim/ ~/
> - Run vanilla Vim and set 'runtimepath'
>   $ vim -Nu NONE +"set rtp=~/.vim,~/.vim/after"
> 
> - Adding package 'bar'
>   :packadd bar
> 
> - Confirm 'rtp'
>   :echo rtp
> 
> Expect value:
>   runtimepath=~/.vim,~/sample/.vim/pack/dist/opt/bar,~/.vim/after
> Actual value:
>   runtimepath=~/.vim,~/.vim/after,~/sample/.vim/pack/dist/opt/bar
> 
> '~/sample/.vim/pack/dist/opt/bar' should be added immediately after '~/.vim'.
> Because '~/sample/.vim/pack/dist/opt/bar' is included in '~/.vim'.
> 
> REMARKS:
> This phenomenon does not occur if ~/.vim is not a symbolic link.
> 
> 
> Investigation result:
> in add_pack_plugin(),
> 3510     char_u  *ffname = fix_fname(fname);
> ...
> 3535    insp = p_rtp;
> 3536    for (;;)
> 3537    {
> 3538        if (vim_fnamencmp(insp, ffname, fname_len) == 0)
> 3539        break;
> 3540        insp = vim_strchr(insp, ',');
> 3541        if (insp == NULL)
> 3542        break;
> 3543        ++insp;
> 3544    }
> 
> Although fix_fname() returns the path that resolved the symbolic link, each 
> 'rtp' directory does not do it.
> 
> 
> I wrote a patch contains test.
> Check it please.
> 
> NOTE:
> This issue was reported by Norio Takagi.
> https://github.com/vim-jp/issues/issues/1022 (in Japanese)

Thanks.  This was also near the top of the todo list.

I'll fix the memory leak.

I wonder if this could result in duplicate entries, since the check
whether the directory already is in runtime path does not resolve
symlinks.  I could not make this happen though.

-- 
So when I saw the post to comp.editors, I rushed over to the FTP site to
grab it.  So I yank apart the tarball, light x candles, where x= the
vim version multiplied by the md5sum of the source divided by the MAC of
my NIC (8A3FA78155A8A1D346C3C4A), put on black robes, dim the lights,
wave a dead chicken over the hard drive, and summon the power of GNU GCC
with the magic words "make config ; make!".
                [Jason Spence, compiling Vim 5.0]

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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