Make g:startify_custom_header handle empty string

eval() throws errors on empty strings.
This commit is contained in:
Marco Hinz 2018-04-26 13:15:01 +02:00
parent bd297e5798
commit ca03433196
No known key found for this signature in database
GPG key ID: 1C980A1B657B4A4F

View file

@ -86,7 +86,9 @@ function! startify#insane_in_the_membrane() abort
if type(g:startify_custom_header) == type([])
let g:startify_header = copy(g:startify_custom_header)
elseif type(g:startify_custom_header) == type('')
let g:startify_header = eval(g:startify_custom_header)
let g:startify_header = empty(g:startify_custom_header)
\ ? []
\ : eval(g:startify_custom_header)
else
echomsg 'startify: wrong type of value for g:startify_custom_header'
let g:startify_header = startify#fortune#cowsay()