Replace strcharpart() with substitute() for backward compatibility
This commit is contained in:
parent
6aff1b6cd3
commit
b45f2c27ea
@ -288,7 +288,7 @@ function! s:Bookmark.str()
|
||||
let pathStr = self.path.str({'format': 'UI'})
|
||||
if strdisplaywidth(pathStr) > pathStrMaxLen
|
||||
while strdisplaywidth(pathStr) > pathStrMaxLen && strchars(pathStr) > 0
|
||||
let pathStr = strcharpart(pathStr, 1)
|
||||
let pathStr = substitute(pathStr, '.\{1}', '', '')
|
||||
endwhile
|
||||
let pathStr = '<' . pathStr
|
||||
endif
|
||||
|
@ -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 = strcharpart(toReturn, 1)
|
||||
let toReturn = substitute(toReturn, '.\{1}', '', '')
|
||||
endwhile
|
||||
if len(split(toReturn, '/')) > 1
|
||||
let toReturn = '</' . join(split(toReturn, '/')[1:], '/') . '/'
|
||||
|
Loading…
x
Reference in New Issue
Block a user