mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 11:53:48 -05:00
Fixed bug 'unknown function strcharpart' for older versions of Vim
This commit is contained in:
@@ -287,10 +287,14 @@ 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)
|
||||
endwhile
|
||||
let pathStr = '<' . pathStr
|
||||
if exists("*strcharpart")
|
||||
while strdisplaywidth(pathStr) > pathStrMaxLen && strchars(pathStr) > 0
|
||||
let pathStr = strcharpart(pathStr, 1)
|
||||
endwhile
|
||||
let pathStr = '<' . pathStr
|
||||
else
|
||||
let pathStr = '<' . strpart(pathStr, len(pathStr) - pathStrMaxLen)
|
||||
endif
|
||||
endif
|
||||
return '>' . self.name . ' ' . pathStr
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user