As title. I have a pair of autocmds which needs each other:
- One on
WinLeave
, this one is fine since it will be triggered when I call:vsplit
. - One on
BufEnter
, this one is NOT fine for the edge case, i.e.:vsplit
.
Every time WinLeave
happens, it will call a function, which expects a pairing-function to be called on BufEnter
. If I have no buffer opened in many windows, then no problem. But I just realized that calling :vsplit
create the only edge case: BufEnter
will not be triggered, thus the function from WinLeave
will not be paired with the pairing-function from BufEnter
.
I did try WinEnter
but it doesn't satisfy my requirement. That is: the timing is different. BufEnter
is called later than WinEnter
. If I use WinEnter
then the pairing-function will be called too early. So is there any way so that BufEnter
can also be triggered on the same buffer in different window?