Make startify#center() use window width (#464)

This commit is contained in:
ndavid 2021-04-23 19:19:48 +01:00 committed by GitHub
parent 3ffa62fbe7
commit df0f1dbdc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -442,7 +442,7 @@ endfunction
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')
\ 'repeat(" ", (winwidth(0) / 2) - (longest_line / 2) - 1) . v:val')
endfunction
" Function: s:get_lists {{{1