From ba2604474632ebcbf014baaffb026194556c3476 Mon Sep 17 00:00:00 2001 From: Giacomo Comitti Date: Thu, 20 Nov 2014 07:50:47 +0100 Subject: [PATCH] Truncate paths at slashes. --- lib/nerdtree/path.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim index ea6aa03..dbecb02 100644 --- a/lib/nerdtree/path.vim +++ b/lib/nerdtree/path.vim @@ -623,8 +623,13 @@ function! s:Path.str(...) if has_key(options, 'truncateTo') let limit = options['truncateTo'] - if len(toReturn) > limit - let toReturn = "<" . strpart(toReturn, len(toReturn) - limit + 1) + if len(toReturn) > limit-1 + let toReturn = toReturn[(len(toReturn)-limit+1):] + if len(split(toReturn, '/')) > 1 + let toReturn = '