Do not cache options
There was never a technical reason for it anyway. Closes https://github.com/mhinz/vim-startify/issues/409
This commit is contained in:
parent
04ad724e80
commit
60bae7f08e
2 changed files with 42 additions and 40 deletions
|
@ -22,7 +22,7 @@ endfunction
|
|||
|
||||
" Function: #quote {{{1
|
||||
function! startify#fortune#quote() abort
|
||||
return s:quotes[s:get_random_offset(len(s:quotes))]
|
||||
return g:startify_custom_header_quotes[s:get_random_offset(len(g:startify_custom_header_quotes))]
|
||||
endfunction
|
||||
|
||||
" Function: #boxed {{{1
|
||||
|
@ -73,14 +73,14 @@ let s:cow = [
|
|||
\ ' || ||',
|
||||
\ ]
|
||||
|
||||
let s:unicode = &encoding == 'utf-8' && get(g:, 'startify_fortune_use_unicode')
|
||||
let g:startify_fortune_use_unicode = &encoding == 'utf-8' && get(g:, 'startify_fortune_use_unicode')
|
||||
|
||||
let s:char_top_bottom = ['-', '─'][s:unicode]
|
||||
let s:char_sides = ['|', '│'][s:unicode]
|
||||
let s:char_top_left = ['*', '╭'][s:unicode]
|
||||
let s:char_top_right = ['*', '╮'][s:unicode]
|
||||
let s:char_bottom_right = ['*', '╯'][s:unicode]
|
||||
let s:char_bottom_left = ['*', '╰'][s:unicode]
|
||||
let s:char_top_bottom = ['-', '─'][g:startify_fortune_use_unicode]
|
||||
let s:char_sides = ['|', '│'][g:startify_fortune_use_unicode]
|
||||
let s:char_top_left = ['*', '╭'][g:startify_fortune_use_unicode]
|
||||
let s:char_top_right = ['*', '╮'][g:startify_fortune_use_unicode]
|
||||
let s:char_bottom_right = ['*', '╯'][g:startify_fortune_use_unicode]
|
||||
let s:char_bottom_left = ['*', '╰'][g:startify_fortune_use_unicode]
|
||||
|
||||
let s:predefined_quotes = [
|
||||
\ ["Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.", '', '- Brian Kernighan'],
|
||||
|
@ -238,6 +238,6 @@ let s:predefined_quotes = [
|
|||
\ ['What one programmer can do in one month, two programmers can do in two months.', '', '- Frederick P. Brooks'],
|
||||
\ ]
|
||||
|
||||
let s:quotes = exists('g:startify_custom_header_quotes')
|
||||
let g:startify_custom_header_quotes = exists('g:startify_custom_header_quotes')
|
||||
\ ? g:startify_custom_header_quotes
|
||||
\ : startify#fortune#predefined_quotes()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue