Greg Hurrell wrote:

> Running Vim 7.4 (patches 1-1795) I've found that files under an
> "after" directory are not being evaluated when inside a package, but
> they run when installed the old-fashioned way.
> 
> The plug-in contains the following files:
> 
> - ftplugin/vim.vim
> - after/syntax/vim.vim
> 
> By adding an `:echomsg` command in each of these files, I can see the
> "ftplugin" file gets executed but the "after" file does not get loaded
> as I would expect when editing a .vim file.

This is to be expected.  The "after" directory is a separate entry in
'runtimepath'.  It was meant to be used to override a plugin with your
presonal preferences.  It was not intended to be used by a plugin you
install with a plugin manager or with a package.

> The actual locations of the files on my system when installed as a
> package are:
> 
> - ~/.vim/pack/bundle/start/vim-docvim/ftplugin/vim.vim
> - ~/.vim/pack/bundle/start/vim-docvim/after/syntax/vim.vim
> 
> My 'packpath' is default:
> 
> packpath=~/.vim,/usr/local/share/vim/vimfiles,/usr/local/share/vim/vim74,/usr/local/share/vim/vimfiles/after,~/.vim/after
> 
> I'm doing the following in my ~/.vim/vimrc:
> 
> if has('packages')
>   packloadall
> else
>   " Use Pathogen for plug-in loading.
>   source $HOME/.vim/pack/bundle/opt/vim-pathogen/autoload/pathogen.vim
>   call pathogen#infect('pack/bundle/start/{}')
> endif
> 
> As you can see, in older versions of Vim I manage my runtimepath with
> vim-pathogen. In that case, the "after" file _does_ load as expected.
> 
> For reference, the plug-in I'm referencing here is:
> 
> https://github.com/wincent/vim-docvim
> 
> Does this sound like a bug, or is the different behavior expected when
> using packages?

That makes me wonder why you need to use the "after" directory in a
plugin or package.  I see this plugin adds more Vim script highlighting.
That seems to be a valid reason.  I can't think of another way to do
this, without making changes to the Vim syntax highlighting file.

We could add the "after" directory for a package.  But that means
'runtimepath' will more than double.  And for most packages the
directory would not even exist.

I suppose we could check for the existence of this "after" directory and
only append it to 'runtimepath' if it exists.  This check is then only
done once if the directory does not exist.  Instead of every time
'runtimepath' is used.

-- 
Zen Microsystems: we're the om in .commmmmmmmm

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui