|
@@ -126,7 +126,7 @@ endfunction
|
|
|
|
|
|
|
|
" Function: s:draw_box {{{1
|
|
" Function: s:draw_box {{{1
|
|
|
function! s:draw_box(lines) abort
|
|
function! s:draw_box(lines) abort
|
|
|
- let longest_line = max(map(copy(a:lines), 'len(v:val)'))
|
|
|
|
|
|
|
+ let longest_line = max(map(copy(a:lines), 'strwidth(v:val)'))
|
|
|
if &encoding == 'utf-8' && get(g:, 'startify_fortune_use_unicode')
|
|
if &encoding == 'utf-8' && get(g:, 'startify_fortune_use_unicode')
|
|
|
let top_left_corner = '╭'
|
|
let top_left_corner = '╭'
|
|
|
let top_right_corner = '╮'
|
|
let top_right_corner = '╮'
|
|
@@ -146,7 +146,7 @@ function! s:draw_box(lines) abort
|
|
|
let bottom = bottom_left_corner . repeat(top_bottom_side, longest_line + 2) . bottom_right_corner
|
|
let bottom = bottom_left_corner . repeat(top_bottom_side, longest_line + 2) . bottom_right_corner
|
|
|
let lines = [top]
|
|
let lines = [top]
|
|
|
for l in a:lines
|
|
for l in a:lines
|
|
|
- let offset = longest_line - len(l)
|
|
|
|
|
|
|
+ let offset = longest_line - strwidth(l)
|
|
|
let lines += [side . ' '. l . repeat(' ', offset) .' ' . side]
|
|
let lines += [side . ' '. l . repeat(' ', offset) .' ' . side]
|
|
|
endfor
|
|
endfor
|
|
|
let lines += [bottom]
|
|
let lines += [bottom]
|