diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2015-11-18 13:41:54 +0100 |
---|---|---|
committer | Marco Hinz <mh.codebro@gmail.com> | 2015-11-18 13:41:54 +0100 |
commit | 959f2601f982bb911c83cc6e948f06abd2e9c140 (patch) | |
tree | cba983995683ff90e0b528ea6ab789da5a3a1dca /src/nvim/normal.c | |
parent | ed06071f1f61f625c3fef46e24b57d563852e4c9 (diff) | |
parent | f480b38a2f28cda9e8eb2d9aa9430f01a4a7064d (diff) | |
download | rneovim-959f2601f982bb911c83cc6e948f06abd2e9c140.tar.gz rneovim-959f2601f982bb911c83cc6e948f06abd2e9c140.tar.bz2 rneovim-959f2601f982bb911c83cc6e948f06abd2e9c140.zip |
Merge PR #3488 'Implement handling of terminal focus events'
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index d6bc416c91..78df4ea7ea 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -349,6 +349,8 @@ static const struct nv_cmd { {K_F8, farsi_fkey, 0, 0}, {K_F9, farsi_fkey, 0, 0}, {K_EVENT, nv_event, NV_KEEPREG, 0}, + {K_FOCUSGAINED, nv_focusgained, NV_KEEPREG, 0}, + {K_FOCUSLOST, nv_focuslost, NV_KEEPREG, 0}, }; /* Number of commands in nv_cmds[]. */ @@ -7715,6 +7717,18 @@ static void nv_event(cmdarg_T *cap) cap->retval |= CA_COMMAND_BUSY; // don't call edit() now } +/// Trigger FocusGained event. +static void nv_focusgained(cmdarg_T *cap) +{ + apply_autocmds(EVENT_FOCUSGAINED, NULL, NULL, false, curbuf); +} + +/// Trigger FocusLost event. +static void nv_focuslost(cmdarg_T *cap) +{ + apply_autocmds(EVENT_FOCUSLOST, NULL, NULL, false, curbuf); +} + /* * Return TRUE when 'mousemodel' is set to "popup" or "popup_setpos". */ |