Make startify#fortune#boxe() handle funcref

References #285.
This commit is contained in:
Marco Hinz 2017-06-05 13:16:04 +02:00
parent 1940c9f9b9
commit 53c53b2444
No known key found for this signature in database
GPG key ID: 1C980A1B657B4A4F
2 changed files with 9 additions and 4 deletions

View file

@ -159,7 +159,8 @@ endfunction
" Function: #boxed {{{1
function! startify#fortune#boxed(...) abort
let wrapped_quote = []
let quote = a:0 && type(a:1) == type([]) ? a:1 : startify#fortune#quote()
let Quote = a:0 && type(a:1) == type([]) ? a:1 : startify#fortune#quote()
let quote = type(Quote) == type(function('tr')) ? Quote() : Quote
for line in quote
let wrapped_quote += split(line, '\%50c.\{-}\zs\s', 1)
endfor