mirror of
https://github.com/preservim/nerdtree.git
synced 2024-12-03 00:03:44 +08:00
implement copying nodes for windows
This commit is contained in:
parent
332a1baedd
commit
21601d9c3d
10
plugin/NERD_tree.vim
Normal file → Executable file
10
plugin/NERD_tree.vim
Normal file → Executable file
|
@ -83,6 +83,7 @@ let s:running_windows = has("win16") || has("win32") || has("win64")
|
||||||
"Note: the space after the command is important
|
"Note: the space after the command is important
|
||||||
if s:running_windows
|
if s:running_windows
|
||||||
call s:InitVariable("g:NERDTreeRemoveDirCmd", 'rmdir /s /q ')
|
call s:InitVariable("g:NERDTreeRemoveDirCmd", 'rmdir /s /q ')
|
||||||
|
call s:InitVariable("g:NERDTreeCopyCmd", 'copy /Y ')
|
||||||
else
|
else
|
||||||
call s:InitVariable("g:NERDTreeRemoveDirCmd", 'rm -rf ')
|
call s:InitVariable("g:NERDTreeRemoveDirCmd", 'rm -rf ')
|
||||||
call s:InitVariable("g:NERDTreeCopyCmd", 'cp -r ')
|
call s:InitVariable("g:NERDTreeCopyCmd", 'cp -r ')
|
||||||
|
@ -1150,9 +1151,14 @@ function! s:oPath.Copy(dest) dict
|
||||||
throw "NERDTree.Path.CopyingNotSupported Exception: Copying is not supported on this OS"
|
throw "NERDTree.Path.CopyingNotSupported Exception: Copying is not supported on this OS"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let dest = s:oPath.WinToUnixPath(a:dest)
|
"let dest = s:oPath.WinToUnixPath(a:dest)
|
||||||
|
let dest = a:dest
|
||||||
|
|
||||||
|
if s:running_windows
|
||||||
|
let cmd = g:NERDTreeCopyCmd . " " . self.StrForOS(1) . " \"" . dest . '"'
|
||||||
|
else
|
||||||
let cmd = g:NERDTreeCopyCmd . " " . self.StrForOS(0) . " " . dest
|
let cmd = g:NERDTreeCopyCmd . " " . self.StrForOS(0) . " " . dest
|
||||||
|
endif
|
||||||
let success = system(cmd)
|
let success = system(cmd)
|
||||||
if success != 0
|
if success != 0
|
||||||
throw "NERDTree.Path Exception: Could not copy ''". self.StrForOS(0) ."'' to: '" . a:dest . "'"
|
throw "NERDTree.Path Exception: Could not copy ''". self.StrForOS(0) ."'' to: '" . a:dest . "'"
|
||||||
|
@ -3002,7 +3008,7 @@ function! s:CopyNode()
|
||||||
let newNodePath = input("Copy the current node\n" .
|
let newNodePath = input("Copy the current node\n" .
|
||||||
\ "==========================================================\n" .
|
\ "==========================================================\n" .
|
||||||
\ "Enter the new path to copy the node to: \n" .
|
\ "Enter the new path to copy the node to: \n" .
|
||||||
\ "", currentNode.path.Str(0))
|
\ "", currentNode.path.StrForOS(0))
|
||||||
|
|
||||||
if newNodePath != ""
|
if newNodePath != ""
|
||||||
"strip trailing slash
|
"strip trailing slash
|
||||||
|
|
Loading…
Reference in New Issue
Block a user