refactor the Path#str* methods

This commit is contained in:
marty
2009-09-01 17:15:48 +12:00
parent 8fc72fd352
commit 0dda0ce5d7
4 changed files with 78 additions and 63 deletions

View File

@@ -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)