Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
Bug fix: length of composite characters in stl_format.
Browse files Browse the repository at this point in the history
  • Loading branch information
lcd047 committed Sep 23, 2015
1 parent 66f4e96 commit b8aef00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions autoload/syntastic/util.vim
Expand Up @@ -369,15 +369,13 @@ function! syntastic#util#wformat(format, str) abort " {{{2
let out = substitute(a:str, "\t", ' ', 'g')

if maxlen && s:_width(out) > maxlen
let chars = filter(split(a:str, '\zs\ze', 1), 'v:val !=# ""')
let totlen = 0
let chars = filter(split(out, '\zs\ze', 1), 'v:val !=# ""')
let out = ''

if flushleft
for c in chars
if totlen + s:_width(c) < maxlen
if s:_width(out . c) < maxlen
let out .= c
let totlen += s:_width(c)
else
let out .= &encoding ==# 'utf-8' && &termencoding ==# 'utf-8' ? "\u2026" : '>'
break
Expand All @@ -386,9 +384,8 @@ function! syntastic#util#wformat(format, str) abort " {{{2
else
call reverse(chars)
for c in chars
if totlen + s:_width(c) < maxlen
if s:_width(c . out) < maxlen
let out = c . out
let totlen += s:_width(c)
else
let out = (&encoding ==# 'utf-8' && &termencoding ==# 'utf-8' ? "\u2026" : '<') . out
break
Expand Down
2 changes: 1 addition & 1 deletion plugin/syntastic.vim
Expand Up @@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START
endif

let g:_SYNTASTIC_VERSION = '3.6.0-173'
let g:_SYNTASTIC_VERSION = '3.6.0-174'
lockvar g:_SYNTASTIC_VERSION

" Sanity checks {{{1
Expand Down

0 comments on commit b8aef00

Please sign in to comment.