Better handling of tab characters using strdisplaywidth

This commit is contained in:
Junegunn Choi
2014-04-11 10:39:39 +09:00
parent d041e17bba
commit ba54df53ca
2 changed files with 24 additions and 2 deletions

View File

@@ -67,9 +67,9 @@ let s:shorthand = {
\ 'mode_sequence': 'm', 'ignores': 'ig', 'filter': 'f'
\ }
if exists("*strwidth")
if exists("*strdisplaywidth")
function! s:strwidth(str)
return strwidth(a:str) + len(matchstr(a:str, '^\t*')) * (&tabstop - 1)
return strdisplaywidth(a:str)
endfunction
else
function! s:strwidth(str)