1 " $Id$ vim: set syntax=vim:
2 " Define the function we'll use. It's easier to do this than to faff about
3 " trying to run a sequence of normal mode commands.
5 " Allow closing an unmodified spec.
8 " Create a new window, move it below the spec and read in a diff.
13 " Delete the blank line left above the diff.
21 " Switch back to the top window.
25 " Expand the command line window so we don't have to press RETURN later.
26 let s:cmdheight = &cmdheight
29 " Call and then discard our function.
33 " Restore the command window.
34 exe "se cmdheight=" . s:cmdheight
36 " Close the scratch buffer.
38 " Vim 7 lets us close the buffer by number. The changelist is always in #1.
39 au BufWinLeave <buffer=1> qa!
41 " Prior versions can only do it by name. Fall back to a temporary file.
42 au BufWinLeave /tmp/tmp.*.* qa!