File tree Expand file tree Collapse file tree 2 files changed +7
-15
lines changed
Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -287,14 +287,10 @@ function! s:Bookmark.str()
287287
288288 let pathStr = self .path .str ({' format' : ' UI' })
289289 if strdisplaywidth (pathStr) > pathStrMaxLen
290- if exists (" *strcharpart" )
291- while strdisplaywidth (pathStr) > pathStrMaxLen && strchars (pathStr) > 0
292- let pathStr = strcharpart (pathStr, 1 )
293- endwhile
294- let pathStr = ' <' . pathStr
295- else
296- let pathStr = ' <' . strpart (pathStr, len (pathStr) - pathStrMaxLen)
297- endif
290+ while strdisplaywidth (pathStr) > pathStrMaxLen && strchars (pathStr) > 0
291+ let pathStr = substitute (pathStr, ' ^.' , ' ' , ' ' )
292+ endwhile
293+ let pathStr = ' <' . pathStr
298294 endif
299295 return ' >' . self .name . ' ' . pathStr
300296endfunction
Original file line number Diff line number Diff line change @@ -720,13 +720,9 @@ function! s:Path.str(...)
720720 if has_key (options , ' truncateTo' )
721721 let limit = options [' truncateTo' ]
722722 if strdisplaywidth (toReturn) > limit- 1
723- if exists (" *strcharpart" )
724- while strdisplaywidth (toReturn) > limit- 1 && strchars (toReturn) > 0
725- let toReturn = strcharpart (toReturn, 1 )
726- endwhile
727- else
728- let toReturn = toReturn[(len (toReturn)- limit+ 1 ):]
729- endif
723+ while strdisplaywidth (toReturn) > limit- 1 && strchars (toReturn) > 0
724+ let toReturn = substitute (toReturn, ' ^.' , ' ' , ' ' )
725+ endwhile
730726 if len (split (toReturn, ' /' )) > 1
731727 let toReturn = ' </' . join (split (toReturn, ' /' )[1 :], ' /' ) . ' /'
732728 else
You can’t perform that action at this time.
0 commit comments