On 2016-07-04 09:29:44 +0000, Bram Moolenaar said:
Nicola wrote:
On 2016-07-03 20:24:27 +0000, bstaletic (Vim Github Repository) said:
If YouCompleteMe is placed in $HOME/.vim/pack/ycm/start/YouCompleteMe
it works perfectly, but if it is place in opt in stead of start it
doesn't even load.
As the manual says, packadd just sources the plugin file. YCM does some
initialization on VimEnter, and that needs to be performed manually:
packadd youcompleteme
call youcompleteme#Enable()
Since :packadd is new it's not unexpected that some scripts, that were
written to be loaded on startup, don't completely work when started in
another way.
It should be easy to fix, the script can detect that VimEnter has
already happened and instead call the function right away. There
actually is an example right at the help for VimEnter:
if v:vim_did_enter
call s:init()
else
au VimEnter * call s:init()
endif
That's what the proposed pull request does. It checks `has('vim_starting')`
rather than `v:vim_did_enter`, but that should be also ok, shouldn't it?
(Correct me if I'm wrong: `v:vim_did_enter` has been introduced only recently,
so using `vim_starting` may be compatible with older versions.)
Nicola
--
--
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.