From bba214f6b39d782c15f2d97fbc98fd0d18ace909 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Sun, 27 Oct 2019 02:35:20 +0200 Subject: [PATCH] Fortune: quote might be a funcref Fixes https://github.com/mhinz/vim-startify/issues/396 --- autoload/startify/fortune.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/startify/fortune.vim b/autoload/startify/fortune.vim index f8ecfd0..9745c37 100644 --- a/autoload/startify/fortune.vim +++ b/autoload/startify/fortune.vim @@ -28,7 +28,12 @@ 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() + if a:0 && type(a:1) == type([]) + let quote = a:1 + else + let Quote = startify#fortune#quote() + let quote = type(Quote) == type(function('tr')) ? Quote() : Quote + endif for line in quote let wrapped_quote += split(line, '\%50c.\{-}\zs\s', 1) endfor