From b8aef009b15d5790df0bdd71d3cf32381ee4536a Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Wed, 23 Sep 2015 17:48:39 +0300 Subject: [PATCH] Bug fix: length of composite characters in stl_format. --- autoload/syntastic/util.vim | 9 +++------ plugin/syntastic.vim | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/autoload/syntastic/util.vim b/autoload/syntastic/util.vim index 9dbf4116..844a4ed9 100644 --- a/autoload/syntastic/util.vim +++ b/autoload/syntastic/util.vim @@ -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 @@ -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 diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 8855fab5..5871306e 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -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