X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.vim%2Fscript%2Fp4;h=9319906d7a7ac4cc9ed21c6a8b7bf731a4cc94b2;hb=a994152e93116a14471a7d47afd2234455329283;hp=9f77833de1c57151e7640cd8a02be0017d0c44af;hpb=258988f92389cb66122778b4876a1390b7e6ae00;p=profile.git diff --git a/.vim/script/p4 b/.vim/script/p4 index 9f77833..9319906 100644 --- a/.vim/script/p4 +++ b/.vim/script/p4 @@ -15,9 +15,14 @@ fun! P4submit() " Allow closing an unmodified spec. set nomod + " Get the files in the changelist. + let l:files = system("sed -n 's@^ \\(//.*\\) #.*@\\1@p' " . bufname("")) " Create a new window, move it below the spec and read in a diff. botright new - r!p4 diff + if l:files != "" + exe "r!env P4DIFF= p4 diff -du " . substitute(l:files, "\n", " ", "g") + endif + setf diff " Delete the blank line left above the diff.