From 8aafa66eac46eb1a4fb5a3e147cab98f0ddcc248 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sat, 10 May 2008 15:33:11 +1200 Subject: [PATCH] handle trailing slashes inside oPath#Rename previously the RenameCurrent() view function was removing trailing slashes from the destination path before passing it to oPath, now oPath handles the slashes --- plugin/NERD_tree.vim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index ff3ff12..e06832b 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -308,7 +308,8 @@ endfunction "FUNCTION: oTreeFileNode.Rename {{{3 "Calls the rename method for this nodes path obj function! s:oTreeFileNode.Rename(newName) dict - call self.path.Rename(a:newName) + let newName = substitute(a:newName, '\(\\\|\/\)$', '', '') + call self.path.Rename(newName) call self.parent.RemoveChild(self) let parentPath = self.path.GetPathTrunk() @@ -2843,8 +2844,6 @@ function! s:RenameCurrent() return endif - let newNodePath = substitute(newNodePath, '\/$', '', '') - try let bufnum = bufnr(curNode.path.Str(0))