Fortune: handle multibyte characters
This commit is contained in:
parent
89bf0a5c24
commit
f3044c7f52
2 changed files with 3 additions and 3 deletions
|
@ -838,7 +838,7 @@ How do I center my header/footer?~
|
|||
Try something along these lines:
|
||||
>
|
||||
function! s:filter_header(lines) abort
|
||||
let longest_line = max(map(copy(a:lines), 'len(v:val)'))
|
||||
let longest_line = max(map(copy(a:lines), 'strwidth(v:val)'))
|
||||
let centered_lines = map(copy(a:lines),
|
||||
\ 'repeat(" ", (&columns / 2) - (longest_line / 2)) . v:val')
|
||||
return centered_lines
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue