junegunn / vim-plug

:hibiscus: Minimalist Vim Plugin Manager
https://junegunn.github.io/vim-plug/
MIT License
33.92k stars 1.93k forks source link

Post-update hook unable to find `vim-doge` function #1148

Closed shyun3 closed 5 months ago

shyun3 commented 2 years ago

Post-update hook is unable to find doge#helpers#deepextend when using

Plug 'kkoomen/vim-doge', { 'do': { -> doge#install() } }

Manually running :call doge#install() afterwards works just fine.

This seems to be related to #964. See also my comment in a related issue on the vim-doge repo.


NVIM v0.6.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-prot
ector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/wo
rk/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az65-618

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/home/runner/work/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info
jiz4oh commented 2 years ago

It seems like a neovim bug. PlugInstall works well at vim.

tomtomjhj commented 2 years ago

It seems that recent nvim ignores paths that are not existent at the moment of setting rtp. So post-update hook fails for freshly installed plugins, while it works for updated plugins.

Refreshing rtp before running the post-update hook worked for me.

@@ -1031,6 +1031,7 @@ function! s:is_updated(dir)
 endfunction

 function! s:do(pull, force, todo)
+  let &rtp = &rtp
   for [name, spec] in items(a:todo)
     if !isdirectory(spec.dir)
       continue
psliwka commented 2 years ago

Relevant neovim issue: https://github.com/neovim/neovim/issues/18822

junegunn commented 5 months ago

Fixed by https://github.com/junegunn/vim-plug/commit/2f8f04cf79f424aab8c2372d8e0b89099e3dba65