From: Iain Patterson Date: Wed, 13 Aug 2008 08:41:42 +0000 (+0000) Subject: Vim 6 can't close a buffer by number. Fall back to a guess of the filename. X-Git-Url: http://git.iain.cx/?p=profile.git;a=commitdiff_plain;h=dfa89955cebc320a07b0228f743c000a838bf601 Vim 6 can't close a buffer by number. Fall back to a guess of the filename. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@134 6be0d1a5-5cfe-0310-89b6-964be062b18b --- 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 diff --git a/.vim/script/svn b/.vim/script/svn index c47f218..fcca7e4 100644 --- a/.vim/script/svn +++ b/.vim/script/svn @@ -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! SVNcommit() @@ -34,4 +34,10 @@ delfunction SVNcommit exe "se 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