mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
refactor the Path#str* methods
This commit is contained in:
@@ -30,7 +30,7 @@ function! NERDTreeExecFile()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
echo "==========================================================\n"
|
||||
echo "Complete the command to execute (add arguments etc):\n"
|
||||
let cmd = treenode.path.strForOS(1)
|
||||
let cmd = treenode.path.str({'format': 'OS', 'escape': 1})
|
||||
let cmd = input(':!', cmd . ' ')
|
||||
|
||||
if cmd != ''
|
||||
|
||||
@@ -57,7 +57,7 @@ function! NERDTreeAddNode()
|
||||
let newNodeName = input("Add a childnode\n".
|
||||
\ "==========================================================\n".
|
||||
\ "Enter the dir/file name to be created. Dirs end with a '/'\n" .
|
||||
\ "", curDirNode.path.strForGlob() . g:NERDTreePath.Slash())
|
||||
\ "", curDirNode.path.str({'format': 'Glob'}) . g:NERDTreePath.Slash())
|
||||
|
||||
if newNodeName ==# ''
|
||||
call s:echo("Node Creation Aborted.")
|
||||
@@ -85,7 +85,7 @@ function! NERDTreeMoveNode()
|
||||
let newNodePath = input("Rename the current node\n" .
|
||||
\ "==========================================================\n" .
|
||||
\ "Enter the new path for the node: \n" .
|
||||
\ "", curNode.path.strForOS(0))
|
||||
\ "", curNode.path.str({'format': 'OS'})
|
||||
|
||||
if newNodePath ==# ''
|
||||
call s:echo("Node Renaming Aborted.")
|
||||
|
||||
@@ -66,11 +66,11 @@ endfunction
|
||||
function! NERDTreeGitMove()
|
||||
let node = g:NERDTreeFileNode.GetSelected()
|
||||
let path = node.path
|
||||
let p = path.strForOS(1)
|
||||
let p = path.str({'format': 'OS', 'escape': 1})
|
||||
|
||||
let newPath = input("==========================================================\n" .
|
||||
\ "Enter the new path for the file: \n" .
|
||||
\ "", node.path.strForOS(0))
|
||||
\ "", node.path.str({'format': 'OS'}))
|
||||
if newPath ==# ''
|
||||
call s:echo("git mv aborted.")
|
||||
return
|
||||
@@ -82,19 +82,19 @@ endfunction
|
||||
function! NERDTreeGitAdd()
|
||||
let node = g:NERDTreeFileNode.GetSelected()
|
||||
let path = node.path
|
||||
call s:execGitCmd('add ' . path.strForOS(1))
|
||||
call s:execGitCmd('add ' . path.str({'format': 'OS', 'escape': 1}))
|
||||
endfunction
|
||||
|
||||
function! NERDTreeGitRemove()
|
||||
let node = g:NERDTreeFileNode.GetSelected()
|
||||
let path = node.path
|
||||
call s:execGitCmd('rm ' . path.strForOS(1))
|
||||
call s:execGitCmd('rm ' . path.str({'format': 'OS', 'escape': 1}))
|
||||
endfunction
|
||||
|
||||
function! NERDTreeGitCheckout()
|
||||
let node = g:NERDTreeFileNode.GetSelected()
|
||||
let path = node.path
|
||||
call s:execGitCmd('checkout ' . path.strForOS(1))
|
||||
call s:execGitCmd('checkout ' . path.str({'format': 'OS', 'escape': 1}))
|
||||
endfunction
|
||||
|
||||
function! s:execGitCmd(sub_cmd)
|
||||
|
||||
Reference in New Issue
Block a user