Merge branch 'master' into fix-multibyte-path

This commit is contained in:
bravestarr
2018-04-26 21:20:33 +08:00
committed by GitHub
3 changed files with 17 additions and 11 deletions

View File

@@ -721,7 +721,7 @@ function! s:Path.str(...)
let limit = options['truncateTo']
if strdisplaywidth(toReturn) > limit-1
while strdisplaywidth(toReturn) > limit-1 && strchars(toReturn) > 0
let toReturn = substitute(toReturn, '.\{1}', '', '')
let toReturn = substitute(toReturn, '^.', '', '')
endwhile
if len(split(toReturn, '/')) > 1
let toReturn = '</' . join(split(toReturn, '/')[1:], '/') . '/'