Navigation Menu

Skip to content

Commit

Permalink
Fix #386 add invalid hooks detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Sep 15, 2020
1 parent 945c6bc commit 655488a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autoload/dein/util.vim
Expand Up @@ -331,6 +331,13 @@ function! dein#util#_save_state(is_starting) abort
if has_key(plugin, 'hook_add') && type(plugin.hook_add) == v:t_string
let lines += s:skipempty(plugin.hook_add)
endif

" Invalid hooks detection
for key in keys(filter(copy(plugin),
\ "stridx(v:key, 'hook_') == 0 && type(v:val) != v:t_string"))
call dein#util#_error(
\ printf('%s: "%s" must be string', plugin.name, key))
endfor
endfor

" Add events
Expand Down

0 comments on commit 655488a

Please sign in to comment.