Bram Moolenaar wrote:

Charles Campbell wrote:

Just a suggestion -- I'd appreciate a WinClose event. BufWinLeave would almost do, but if two or more windows are open on the same buffer, then no event. WinLeave fires whenever one changes windows, which isn't what I want, either. Unless I'm misunderstanding the help for these two events.

What would this event be used for?

The WinResized event has also been suggested.  It could be used to
update the Window layout.  It will also be triggered when a window is
closed, since another window will get bigger then.  Would it be
sufficient to only have a WinResized event?  Would these events also be
triggered when closing the last window of a tab page?

Also, if I may point out, concerning the patch I wrote:

The WinClose event took but little extra code to install.  Basically, a line
to define an EVENT_WINCLOSE, a line to map "WinClose" to EVENT_WINCLOSE, and a
single apply_event() call.

OTOH, the patch portion for WinResize involved several more places. As is, there'll be at least two WinResize events when a ctrl-w= (all windows equal sized) is used (one for the vertical, one for the horizontal, resize). You're bound to get someone who wants a VertWinResize and a HorzWinResize (but we can ignore s/he, right?) :) . Plus, I didn't figure out where the mouse-drag resize occurred, so that'd be yet another apply_event(). Seems like that is buried in the gui*.c code, so several drivers would be affected. Not that I'd expect that it'd take but one or two apply_event() calls in each such file.

I'm just pointing out that WinClose is simpler than WinResize.

BTW, what function in gui_x11.c is doing the window-resizing due to mouse dragging?
Curiosity is killing me! :0

Regards,
Chip Campbell

Reply via email to