kristijanhusak / vim-packager

Vim plugin manager that utilizes "jobs" and "pack" features.
MIT License
245 stars 9 forks source link

Error using requires option with list #35

Closed jcrd closed 2 years ago

jcrd commented 2 years ago

I've encountered an error while using the requires option with a list.

call a:packager.add('tools-life/taskwiki', {'requires': ['vimwiki/vimwiki', {'branch': 'dev'}]})

The above produces this error:

Error detected while processing function <SNR>3_run_cmd[2]..<SNR>2_packager_init[31]..2[1]..pa
ckager#plugin#new[1]..52[45]..3:                                                              
line   14:                                                                                    
E605: Exception not caught: Missing "requires" package name for taskwiki.                     
Error detected while processing function <SNR>3_run_cmd[2]..<SNR>2_packager_init[31]..2[1]..pa
ckager#plugin#new[1]..52:                                                                     
line   45:                                                                                    
E170: Missing :endfor

However, wrapping the 'vimwiki' list in another list works:

call a:packager.add('tools-life/taskwiki', {'requires': [['vimwiki/vimwiki', {'branch': 'dev'}]]})
kristijanhusak commented 2 years ago

Yeah you have to wrap it in list. Here's section from readme that shows all possible ways:

  call a:packager.add('haorenW1025/completion-nvim', {'requires': [
  \ ['nvim-treesitter/completion-treesitter', {'requires': 'nvim-treesitter/nvim-treesitter'}],
  \ {'name': 'steelsojka/completion-buffers', 'opts': {'type': 'opt'}},
  \ 'kristijanhusak/completion-tags',
  \ ]})
jcrd commented 2 years ago

Thanks, it wasn't clear based on this example that the surrounding list is required since the dict syntax worked without it. Perhaps the description of requires in packager#add options should be clarified.