I'm attempting to write a small function that toggles a specific buffer. By toggle, I mean quits the window and then splits to reopen it. It is important that I quit the window and not delete the buffer.
I can't seem to find a vim function that allows me to quit a specific window. I have both the buffer name and the window number.
Do I need to iterate over all windows using "wincmd"?
Eric
Your fix works mostly. The only problem is that the window numbers change after you perform the close. I simply kept the original buffer name around and checked its window after the close.
Thanks everyone for the help!
I can't believe how inconsistent vimscript can be.
We need a standard library.
Eric