Add helper functions startify#pad() and startify#center()
This commit is contained in:
parent
a90684813f
commit
aa4f53c9f7
2 changed files with 23 additions and 15 deletions
|
@ -424,6 +424,18 @@ function! startify#open_buffers(...) abort
|
|||
endif
|
||||
endfunction
|
||||
|
||||
" Function: #pad {{{1
|
||||
function! startify#pad(lines) abort
|
||||
return map(copy(a:lines), 's:padding_left . v:val')
|
||||
endfunction
|
||||
|
||||
" Function: #center {{{1
|
||||
function! startify#center(lines) abort
|
||||
let longest_line = max(map(copy(a:lines), 'strwidth(v:val)'))
|
||||
return map(copy(a:lines),
|
||||
\ 'repeat(" ", (&columns / 2) - (longest_line / 2) - 1) . v:val')
|
||||
endfunction
|
||||
|
||||
" Function: s:get_lists {{{1
|
||||
function! s:get_lists() abort
|
||||
if exists('g:startify_lists')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue