Add TabNew event

TabNew triggers when entering a new tab page, but not when entering an
already created one.
This commit is contained in:
Felipe Morales
2014-12-22 02:05:22 -03:00
committed by Justin M. Keyes
parent 0429857689
commit 817be96be5
7 changed files with 37 additions and 1 deletions

View File

@@ -5715,6 +5715,8 @@ void ex_splitview(exarg_T *eap)
if (win_new_tabpage(cmdmod.tab != 0 ? cmdmod.tab
: eap->addr_count == 0 ? 0
: (int)eap->line2 + 1) != FAIL) {
apply_autocmds(EVENT_TABNEW, eap->arg, eap->arg, FALSE, curbuf);
entering_new_tab = true;
do_exedit(eap, old_curwin);
/* set the alternate buffer for the window we came from */

View File

@@ -5247,6 +5247,7 @@ static struct event_name {
{"Syntax", EVENT_SYNTAX},
{"TabEnter", EVENT_TABENTER},
{"TabLeave", EVENT_TABLEAVE},
{"TabNew", EVENT_TABNEW},
{"TermChanged", EVENT_TERMCHANGED},
{"TermResponse", EVENT_TERMRESPONSE},
{"TextChanged", EVENT_TEXTCHANGED},

View File

@@ -95,6 +95,7 @@ typedef enum auto_event {
EVENT_CURSORMOVEDI, /* cursor was moved in Insert mode */
EVENT_TABLEAVE, /* before leaving a tab page */
EVENT_TABENTER, /* after entering a tab page */
EVENT_TABNEW, /* when creating a new tab */
EVENT_SHELLCMDPOST, /* after ":!cmd" */
EVENT_SHELLFILTERPOST, /* after ":1,2!cmd", ":w !cmd", ":r !cmd". */
EVENT_TEXTCHANGED, /* text was modified */