iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.76k stars 280 forks source link

Do not installed/updated when vim-plug with more options by using Win10 Gvim8.1! #41

Closed StarryLeo closed 5 years ago

StarryLeo commented 5 years ago

Hi, friends!

This plugin is work well after successfully installed. " If you don't have nodejs and yarn " use pre build Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }}

But, When I use more options which vim-plug provide, like 'for', 'on', it can not installed/update even I use ! Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': 'markdown', 'on': 'MarkdownPreview' } :PlugUpdate! markdown-preview.nvim

snipaste20190330_205928 snipaste20190330_205928

Then, I test more, I find use the vim command :call mkdp#util#install() can work well ! the install.cmd can successfully run, and the plugin will lazy loading

snipaste20190330_212135 snipaste20190330_212135

Plug 'iamcco/markdown-preview.nvim', { 'do': ':call mkdp#util#install()', 'for': 'markdown', 'on': 'MarkdownPreview' }

I don not know how is work, but I think this is helpful to yours

iamcco commented 5 years ago

You can't use the mkdp#util#install hook to update the plugin when you use lazy load. Because the plugin is not in the runtime path when you update, so the mkdp#util#install is not exists. You have to write your own function to call the install script if you use lazy load.

StarryLeo commented 5 years ago

Eh, I guess maybe you didn't see it clearly. I mean Plug 'iamcco/markdown-preview.nvim', { 'do': ':call mkdp#util#install()', 'for': 'markdown', 'on': 'MarkdownPreview' } can work well with lazy load and normally execute post-update hooks after the plugin updated, why use Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': 'markdown', 'on': 'MarkdownPreview' } can not execute post-update hooks after the plugin updated. And when I check the function about install. I find mkdp#util#pre_build_version() do not work with win10, it means app/bin will update after plugin updated even it do not need, You may want to add .exe for win10 20190331 I done this to pull requests#42

iamcco commented 5 years ago

OK, I got it. Thank you.