File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ endfunction
126
126
127
127
" Function: s:draw_box {{{1
128
128
function ! s: draw_box (lines ) abort
129
- let longest_line = max (map (copy (a: lines ), ' len (v:val)' ))
129
+ let longest_line = max (map (copy (a: lines ), ' strwidth (v:val)' ))
130
130
if &encoding == ' utf-8' && get (g: , ' startify_fortune_use_unicode' )
131
131
let top_left_corner = ' ╭'
132
132
let top_right_corner = ' ╮'
@@ -146,7 +146,7 @@ function! s:draw_box(lines) abort
146
146
let bottom = bottom_left_corner . repeat (top_bottom_side, longest_line + 2 ) . bottom_right_corner
147
147
let lines = [top ]
148
148
for l in a: lines
149
- let offset = longest_line - len (l )
149
+ let offset = longest_line - strwidth (l )
150
150
let lines += [side . ' ' . l . repeat (' ' , offset) .' ' . side]
151
151
endfor
152
152
let lines += [bottom]
Original file line number Diff line number Diff line change @@ -838,7 +838,7 @@ How do I center my header/footer?~
838
838
Try something along these lines:
839
839
>
840
840
function! s:filter_header(lines) abort
841
- let longest_line = max(map(copy(a:lines), 'len (v:val)'))
841
+ let longest_line = max(map(copy(a:lines), 'strwidth (v:val)'))
842
842
let centered_lines = map(copy(a:lines),
843
843
\ 'repeat(" ", (&columns / 2) - (longest_line / 2)) . v:val')
844
844
return centered_lines
You can’t perform that action at this time.
0 commit comments