@@ -698,9 +698,9 @@ if !exists('*ZFDirDiffAPI_mkdir')
698
698
if exists (" *mkdir" )
699
699
call mkdir (a: path , ' p' )
700
700
elseif (has (' win32' ) || has (' win64' )) && ! has (' unix' )
701
- silent execute ' !mkdir "' . substitute (a: path , ' /' , ' \' , ' g' ) . ' " '
701
+ silent execute printf ( ' !mkdir "%s" ' , substitute (a: path , ' /' , ' \' , ' g' ))
702
702
else
703
- silent execute ' !mkdir -p "' . a: path . ' " '
703
+ silent execute printf ( ' !mkdir -p "%s" ' , a: path)
704
704
endif
705
705
endif
706
706
endfunction
@@ -710,29 +710,49 @@ if !exists('*ZFDirDiffAPI_cpfile')
710
710
function ! ZFDirDiffAPI_cpfile (from, to )
711
711
call ZFDirDiffAPI_mkdir (fnamemodify (a: to , " :h" ))
712
712
if (has (' win32' ) || has (' win64' )) && ! has (' unix' )
713
- silent execute ' !copy "' . substitute (a: from , ' /' , ' \' , ' g' ) . ' " " ' . substitute (a: to , ' /' , ' \' , ' g' ) . ' " '
713
+ silent execute printf ( ' !copy "%s" "%s" ' , substitute (a: from , ' /' , ' \' , ' g' ), substitute (a: to , ' /' , ' \' , ' g' ))
714
714
else
715
- silent execute ' !cp -rf "' . a: from . ' " " ' . a: to . ' " '
715
+ silent execute printf ( ' !cp -rf "%s" "%s" ' , a: from, a: to)
716
716
endif
717
717
endfunction
718
718
endif
719
719
720
720
if ! exists (' *ZFDirDiffAPI_rmdir' )
721
721
function ! ZFDirDiffAPI_rmdir (path )
722
722
if (has (' win32' ) || has (' win64' )) && ! has (' unix' )
723
- silent execute ' !rmdir /s/q "' . substitute (a: path , ' /' , ' \' , ' g' ) . ' " '
723
+ silent execute printf ( ' !rmdir /s/q "%s" ' , substitute (a: path , ' /' , ' \' , ' g' ))
724
724
else
725
- silent execute ' !rm -rf "' . a: path . ' " '
725
+ silent execute printf ( ' !rm -rf "%s" ' , a: path)
726
726
endif
727
727
endfunction
728
728
endif
729
729
730
730
if ! exists (' *ZFDirDiffAPI_rmfile' )
731
731
function ! ZFDirDiffAPI_rmfile (path )
732
732
if (has (' win32' ) || has (' win64' )) && ! has (' unix' )
733
- silent execute ' !del /f/q "' . substitute (a: path , ' /' , ' \' , ' g' ) . ' " '
733
+ silent execute printf ( ' !del /f/q "%s" ' , substitute (a: path , ' /' , ' \' , ' g' ))
734
734
else
735
- silent execute ' !rm -f "' . a: path . ' "'
735
+ silent execute printf (' !rm -f "%s"' , a: path )
736
+ endif
737
+ endfunction
738
+ endif
739
+
740
+ if ! exists (' *ZFDirDiffAPI_mvdir' )
741
+ function ! ZFDirDiffAPI_mvdir (from, to )
742
+ if (has (' win32' ) || has (' win64' )) && ! has (' unix' )
743
+ silent execute printf (' !move "%s" "%s"' , a: from , a: to )
744
+ else
745
+ silent execute printf (' !mv "%s" "%s"' , a: from , a: to )
746
+ endif
747
+ endfunction
748
+ endif
749
+
750
+ if ! exists (' *ZFDirDiffAPI_mvfile' )
751
+ function ! ZFDirDiffAPI_mvfile (from, to )
752
+ if (has (' win32' ) || has (' win64' )) && ! has (' unix' )
753
+ silent execute printf (' !move "%s" "%s"' , a: from , a: to )
754
+ else
755
+ silent execute printf (' !mv "%s" "%s"' , a: from , a: to )
736
756
endif
737
757
endfunction
738
758
endif
0 commit comments