X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.vim%2Fscript%2Fp4;h=b226c8754e7a34f76eb2c5078009631733183a8c;hb=dfa89955cebc320a07b0228f743c000a838bf601;hp=0be6351734aea0d48a5fb2e769fcaf2b19c1588d;hpb=fc1fababbed523942492305e847e944757c7dde3;p=profile.git diff --git a/.vim/script/p4 b/.vim/script/p4 index 0be6351..b226c87 100644 --- a/.vim/script/p4 +++ b/.vim/script/p4 @@ -1,4 +1,4 @@ -" $Id$ +" $Id$ vim: set syntax=vim: " Define the function we'll use. It's easier to do this than to faff about " trying to run a sequence of normal mode commands. fun! P4submit() @@ -56,4 +56,10 @@ set noexpandtab exe "set cmdheight=" . s:cmdheight " Close the scratch buffer. -au BufWinLeave qa! +if version >= 700 + " Vim 7 lets us close the buffer by number. The changelist is always in #1. + au BufWinLeave qa! +else + " Prior versions can only do it by name. Fall back to a temporary file. + au BufWinLeave /tmp/tmp.*.* qa! +endif