From b45f2c27ea95bd9eea756061a37b518f9925b332 Mon Sep 17 00:00:00 2001 From: bravestarr Date: Thu, 26 Apr 2018 17:13:06 +0800 Subject: [PATCH] Replace strcharpart() with substitute() for backward compatibility --- lib/nerdtree/bookmark.vim | 2 +- lib/nerdtree/path.vim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nerdtree/bookmark.vim b/lib/nerdtree/bookmark.vim index 307211b..32bf434 100644 --- a/lib/nerdtree/bookmark.vim +++ b/lib/nerdtree/bookmark.vim @@ -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 diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim index f436d36..59c8c69 100644 --- a/lib/nerdtree/path.vim +++ b/lib/nerdtree/path.vim @@ -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 = '