Fix tab handling in status messages.
This commit is contained in:
parent
4740a7ed1f
commit
38f73784e5
@ -110,24 +110,23 @@ function! syntastic#util#wideMsg(msg)
|
|||||||
let old_ruler = &ruler
|
let old_ruler = &ruler
|
||||||
let old_showcmd = &showcmd
|
let old_showcmd = &showcmd
|
||||||
|
|
||||||
"convert tabs to spaces so that the tabs count towards the window width
|
"This is here because it is possible for some error messages to
|
||||||
"as the proper amount of characters
|
"begin with \n which will cause a "press enter" prompt.
|
||||||
let msg = substitute(a:msg, "\t", repeat(" ", &tabstop), "g")
|
let msg = substitute(a:msg, "\n", "", "g")
|
||||||
let msg = strpart(msg, 0, winwidth(0)-1)
|
|
||||||
|
|
||||||
"This is here because it is possible for some error messages to begin with
|
"convert tabs to spaces so that the tabs count towards the window
|
||||||
"\n which will cause a "press enter" prompt. I have noticed this in the
|
"width as the proper amount of characters
|
||||||
"javascript:jshint checker and have been unable to figure out why it
|
let chunks = split(msg, "\t", 1)
|
||||||
"happens
|
let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &ts - len(v:val) % &ts)'), '') . chunks[-1]
|
||||||
let msg = substitute(msg, "\n", "", "g")
|
let msg = strpart(msg, 0, winwidth(0) - 1)
|
||||||
|
|
||||||
set noruler noshowcmd
|
set noruler noshowcmd
|
||||||
call syntastic#util#redraw(0)
|
call syntastic#util#redraw(0)
|
||||||
|
|
||||||
echo msg
|
echo msg
|
||||||
|
|
||||||
let &ruler=old_ruler
|
let &ruler = old_ruler
|
||||||
let &showcmd=old_showcmd
|
let &showcmd = old_showcmd
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Check whether a buffer is loaded, listed, and not hidden
|
" Check whether a buffer is loaded, listed, and not hidden
|
||||||
|
Loading…
Reference in New Issue
Block a user