diff --git a/autoload/syntastic/util.vim b/autoload/syntastic/util.vim index 29855330..6fbf2dff 100644 --- a/autoload/syntastic/util.vim +++ b/autoload/syntastic/util.vim @@ -117,7 +117,7 @@ function! syntastic#util#wideMsg(msg) "convert tabs to spaces so that the tabs count towards the window "width as the proper amount of characters let chunks = split(msg, "\t", 1) - let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &ts - len(v:val) % &ts)'), '') . chunks[-1] + let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &ts - strwidth(v:val) % &ts)'), '') . chunks[-1] let msg = strpart(msg, 0, winwidth(0) - 1) set noruler noshowcmd diff --git a/syntax_checkers/lua/luac.vim b/syntax_checkers/lua/luac.vim index 0139ced3..b62d3f57 100644 --- a/syntax_checkers/lua/luac.vim +++ b/syntax_checkers/lua/luac.vim @@ -21,7 +21,7 @@ set cpo&vim function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos) let result = '' let near = matchstr(a:pos['text'], '\mnear ''\zs[^'']\+\ze''') - if len(near) > 0 + if strlen(near) > 0 if near ==# '' let p = getpos('$') let a:pos['lnum'] = p[1] @@ -35,7 +35,7 @@ function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos) " in future versions of syntastic; enable it at your own risk :) "let open = matchstr(a:pos['text'], '\m(to close ''\zs[^'']\+\ze'' at line [0-9]\+)') - "if len(open) > 0 + "if strlen(open) > 0 " let line = str2nr(matchstr(a:pos['text'], '\m(to close ''[^'']\+'' at line \zs[0-9]\+\ze)')) " let group = a:pos['type'] ==? 'E' ? 'SyntasticError' : 'SyntasticWarning' " call matchadd(group, '\%' . line . 'l\V' . open) diff --git a/syntax_checkers/php/php.vim b/syntax_checkers/php/php.vim index b96ea076..b33f1ded 100644 --- a/syntax_checkers/php/php.vim +++ b/syntax_checkers/php/php.vim @@ -19,11 +19,8 @@ let s:save_cpo = &cpo set cpo&vim function! SyntaxCheckers_php_php_GetHighlightRegex(item) - let unexpected = matchstr(a:item['text'], "\\munexpected '[^']\\+'") - if len(unexpected) < 1 - return '' - endif - return '\V'.split(unexpected, "'")[1] + let term = matchstr(a:item['text'], "\\munexpected '\\zs[^']\\+\\ze'") + return term != '' ? '\V' . term : '' endfunction function! SyntaxCheckers_php_php_GetLocList() dict diff --git a/syntax_checkers/sh/sh.vim b/syntax_checkers/sh/sh.vim index 4e4be67b..bb435cfd 100644 --- a/syntax_checkers/sh/sh.vim +++ b/syntax_checkers/sh/sh.vim @@ -22,7 +22,7 @@ function! s:GetShell() if !exists('b:shell') || b:shell == '' let b:shell = '' let shebang = getbufline(bufnr('%'), 1)[0] - if len(shebang) > 0 + if strlen(shebang) > 0 if stridx(shebang, 'bash') >= 0 let b:shell = 'bash' elseif stridx(shebang, 'zsh') >= 0