Skip to content

Commit

Permalink
Merge pull request #840 from scrooloose/create_parent_directories_on_m-m
Browse files Browse the repository at this point in the history
Like m-c did before, create parent directories if needed on m-m.
  • Loading branch information
lifecrisis authored May 22, 2018
2 parents 6188c5e + c4f8a0f commit 3595304
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/nerdtree/path.vim
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ function! s:Path.rename(newPath)
throw "NERDTree.InvalidArgumentsError: Invalid newPath for renaming = ". a:newPath
endif

call s:Path.createParentDirectories(a:newPath)

let success = rename(self.str(), a:newPath)
if success != 0
throw "NERDTree.PathRenameError: Could not rename: '" . self.str() . "'" . 'to:' . a:newPath
Expand Down
1 change: 1 addition & 0 deletions nerdtree_plugin/fs_menu.vim
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ function! NERDTreeMoveNode()
let bufnum = bufnr("^".curNode.path.str()."$")

call curNode.rename(newNodePath)
call b:NERDTree.root.refresh()
call NERDTreeRender()

"if the node is open in a buffer, ask the user if they want to
Expand Down

0 comments on commit 3595304

Please sign in to comment.