mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-22 11:17:20 +08:00
Like m-c did before, create parent directories if needed on m-m.
This commit is contained in:
parent
6188c5ea5f
commit
c4f8a0f370
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user