From 589f612adfea22b688618fa90e011f5494ca5204 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 12 Sep 2019 16:08:22 -0700 Subject: rename: UIAttach/UIDetach => UIEnter/UILeave "enter"/"leave" is more conventional for Vim events, and "attach"/"detach" distinction does not gain much. --- src/nvim/aucmd.c | 4 ++-- src/nvim/auevents.lua | 8 ++++---- src/nvim/ui.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/nvim/aucmd.c b/src/nvim/aucmd.c index 5188f96a5d..a9a7d834a4 100644 --- a/src/nvim/aucmd.c +++ b/src/nvim/aucmd.c @@ -13,7 +13,7 @@ # include "aucmd.c.generated.h" #endif -void do_autocmd_uiattach(uint64_t chanid, bool attached) +void do_autocmd_uienter(uint64_t chanid, bool attached) { static bool recursive = false; @@ -26,7 +26,7 @@ void do_autocmd_uiattach(uint64_t chanid, bool attached) assert(chanid < VARNUMBER_MAX); tv_dict_add_nr(dict, S_LEN("chan"), (varnumber_T)chanid); tv_dict_set_keys_readonly(dict); - apply_autocmds(attached ? EVENT_UIATTACH : EVENT_UIDETACH, + apply_autocmds(attached ? EVENT_UIENTER : EVENT_UILEAVE, NULL, NULL, false, curbuf); tv_dict_clear(dict); diff --git a/src/nvim/auevents.lua b/src/nvim/auevents.lua index 1505b984ad..c808af37b1 100644 --- a/src/nvim/auevents.lua +++ b/src/nvim/auevents.lua @@ -96,8 +96,8 @@ return { 'TextChangedI', -- text was modified in Insert mode(no popup) 'TextChangedP', -- text was modified in Insert mode(popup) 'TextYankPost', -- after a yank or delete was done (y, d, c) - 'UIAttach', -- after a UI attached - 'UIDetach', -- after a UI detaches + 'UIEnter', -- after UI attaches + 'UILeave', -- after UI detaches 'User', -- user defined autocommand 'VimEnter', -- after starting Vim 'VimLeave', -- before exiting Vim @@ -125,7 +125,7 @@ return { TabNewEntered=true, TermClose=true, TermOpen=true, - UIAttach=true, - UIDetach=true, + UIEnter=true, + UILeave=true, }, } diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 9ff2381189..79fa8b8223 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -296,7 +296,7 @@ void ui_attach_impl(UI *ui, uint64_t chanid) bool is_compositor = (ui == uis[0]); if (!is_compositor) { - do_autocmd_uiattach(chanid, true); + do_autocmd_uienter(chanid, true); } } @@ -333,7 +333,7 @@ void ui_detach_impl(UI *ui, uint64_t chanid) ui_comp_detach(ui); } - do_autocmd_uiattach(chanid, false); + do_autocmd_uienter(chanid, false); } void ui_set_ext_option(UI *ui, UIExtension ext, bool active) -- cgit