aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelipe Morales <hel.sheep@gmail.com>2014-12-22 02:05:22 -0300
committerJustin M. Keyes <justinkz@gmail.com>2015-02-16 23:24:30 -0500
commit817be96be535a8aecc24a72f51fe2d6743ed4a24 (patch)
tree89d896fc8bb6e6f47db50d6f5a2361a2c35b5ab8 /src
parent0429857689ba98356bc80d01ebd540fe861e8db2 (diff)
downloadrneovim-817be96be535a8aecc24a72f51fe2d6743ed4a24.tar.gz
rneovim-817be96be535a8aecc24a72f51fe2d6743ed4a24.tar.bz2
rneovim-817be96be535a8aecc24a72f51fe2d6743ed4a24.zip
Add TabNew event
TabNew triggers when entering a new tab page, but not when entering an already created one.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_docmd.c2
-rw-r--r--src/nvim/fileio.c1
-rw-r--r--src/nvim/fileio.h1
3 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 7ff69a3d41..9d2285acb5 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -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 */
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index dd6e5ace3f..c8944fffe4 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -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},
diff --git a/src/nvim/fileio.h b/src/nvim/fileio.h
index 29bd1307f6..134759577c 100644
--- a/src/nvim/fileio.h
+++ b/src/nvim/fileio.h
@@ -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 */