X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.vim%2Fscript%2Fp4;fp=.vim%2Fscript%2Fp4;h=59e28a11259629ae25ce2c353c4c71572f6fdd9b;hb=21daee34ff2d1d0ca13a79abb315e689ba22d2e3;hp=fe7f252648c4ef627485f004e04833344ea7181b;hpb=76559e10296433ab488b9d9940c50a39282ee49a;p=profile.git diff --git a/.vim/script/p4 b/.vim/script/p4 index fe7f252..59e28a1 100644 --- a/.vim/script/p4 +++ b/.vim/script/p4 @@ -37,7 +37,12 @@ fun! P4submit() set buftype=nowrite set bufhidden=hide setlocal noswapfile + + " Change directory so "file [p4 diff]" doesn't try to cd somewhere. + let l:cwd=getcwd() + cd / file [p4 diff] + cd l:cwd " Switch back to the top window and put the cursor by the description. wincmd k @@ -57,9 +62,6 @@ endfun let s:cmdheight = &cmdheight set cmdheight=3 -" Change directory so "file [p4 diff]" doesn't try to cd somewhere. -cd / - " Call and then discard our function. call P4submit() delfunction P4submit