diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_getln.c | 8 | ||||
-rw-r--r-- | src/nvim/terminal.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 52292128d8..cbaf15e38d 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1448,6 +1448,14 @@ static int command_line_handle_key(CommandLineState *s) } return command_line_not_changed(s); + case K_FOCUSGAINED: // Neovim has been given focus + apply_autocmds(EVENT_FOCUSGAINED, NULL, NULL, false, curbuf); + return command_line_not_changed(s); + + case K_FOCUSLOST: // Neovim has lost focus + apply_autocmds(EVENT_FOCUSLOST, NULL, NULL, false, curbuf); + return command_line_not_changed(s); + default: // Normal character with no special meaning. Just set mod_mask // to 0x0 so that typing Shift-Space in the GUI doesn't enter diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 119ee2c5b3..adf3f725a2 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -402,6 +402,14 @@ static int terminal_execute(VimState *state, int key) TerminalState *s = (TerminalState *)state; switch (key) { + case K_FOCUSGAINED: // Neovim has been given focus + apply_autocmds(EVENT_FOCUSGAINED, NULL, NULL, false, curbuf); + break; + + case K_FOCUSLOST: // Neovim has lost focus + apply_autocmds(EVENT_FOCUSLOST, NULL, NULL, false, curbuf); + break; + case K_LEFTMOUSE: case K_LEFTDRAG: case K_LEFTRELEASE: |