mirror of
https://github.com/vim/vim
synced 2025-07-16 01:01:58 +00:00
patch 9.1.1211: TabClosedPre is triggered just before the tab is being freed
Problem: TabClosedPre is triggered just before the tab is being freed, which limited its functionality. Solution: Trigger it a bit earlier and also on :tabclose and :tabonly (Jim Zhou) closes: #16890 Signed-off-by: Jim Zhou <jimzhouzzy@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
21ac3a49b5
commit
bcf66e0141
@ -6536,6 +6536,8 @@ tabpage_close(int forceit)
|
||||
if (window_layout_locked(CMD_tabclose))
|
||||
return;
|
||||
|
||||
trigger_tabclosedpre(curtab, TRUE);
|
||||
|
||||
// First close all the windows but the current one. If that worked then
|
||||
// close the last window in this tab, that will close it.
|
||||
if (!ONE_WINDOW)
|
||||
@ -6559,6 +6561,8 @@ tabpage_close_other(tabpage_T *tp, int forceit)
|
||||
int done = 0;
|
||||
win_T *wp;
|
||||
|
||||
trigger_tabclosedpre(tp, TRUE);
|
||||
|
||||
// Limit to 1000 windows, autocommands may add a window while we close
|
||||
// one. OK, so I'm paranoid...
|
||||
while (++done < 1000)
|
||||
|
Reference in New Issue
Block a user