From 33eb33bb623a8c01b549683f0db60483e269c7cf Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Fri, 23 Oct 2015 07:00:59 +0100 Subject: Implement handling of terminal focus events Two new keys have been added to key_name_entry in keymap.c: `FocusGained` and `FocusLost`. Two cases have been added to the key handing switch in edit.c each applying their respective autocmds. In normal.c two functions have been added alongside nv_cursorhold doing a similar job of applying the autocmd for the appropriate key. tui/input.c has a new function `handle_focus_event` which eats either of the control sequences for focus gained or lost. This function is checked before handle_bracketed_paste and handle_forced_escape. tui.c registers neovim as able to receive these control sequences in terminfo_start and undoes that in terminfo_stop. Closes #2302 --- src/nvim/keymap.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/keymap.c') diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c index 9d656276ec..85380ba173 100644 --- a/src/nvim/keymap.c +++ b/src/nvim/keymap.c @@ -284,6 +284,8 @@ static struct key_name_entry { {K_SNR, (char_u *)"SNR"}, {K_PLUG, (char_u *)"Plug"}, {K_PASTE, (char_u *)"Paste"}, + {K_FOCUSGAINED, (char_u *)"FocusGained"}, + {K_FOCUSLOST, (char_u *)"FocusLost"}, {0, NULL} }; -- cgit