vim-denops / denops.vim

🐜 An ecosystem of Vim/Neovim which allows developers to write cross-platform plugins in Deno
https://vim-denops.github.io/denops-documentation/
MIT License
666 stars 33 forks source link

plugin loaded check was break when calls plugin load multi times. #387

Closed kuuote closed 1 month ago

kuuote commented 2 months ago

Describe the bug

plugin loaded check was break when calls plugin load multi times.

Provide a minimal vimrc with less than 50 lines to reproduce

set rtp+=/path/to/github.com/vim-denops/denops.vim

function s:reload()
  call denops#plugin#load('a', expand('<script>:h') .. '/a.ts')
  " 0
  echo denops#plugin#is_loaded('a')
endfunction

function s:init()
  call denops#plugin#load('a', expand('<script>:h') .. '/a.ts')
  " 1
  autocmd User DenopsPluginPost:a echo denops#plugin#is_loaded('a')
  autocmd User DenopsPluginPost:a call s:reload()
endfunction

autocmd User DenopsReady call s:init()

a.ts is any plugin. for example:

export function main() {
  console.log("hello");
}

How to reproduce the problem from Vim startup

  1. Place vimrc and a.ts to same directory.

  2. vim -Nu vimrc or nvim -u vimrc

Expected behavior

display 1 and 1

Actual behavior

display 1 and 0

Your environment