% vim
:new
:autocmd BufWinLeave <buffer=1> :2wincmd w | quit
:wincmd p
:q

Guess what, buffer 1 is still loaded and displayed.  Like, WTF?

The reason I want to do this is that I have opened a window that I
want to be dependent on the first window being visible.  This is for
doing diffs.    I've tried basically every combination of autocmds I
could think of, but nothing works.  What gives?

One solution is to do

:autocmd BufWinLeave <buffer=1> :2wincmd w | quit | quit

but that feels so incredibly hackish, and I'm not 100% sure that
BufWinLeave is always equivalent to a :quit.

  nikolai

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui