tmux-plugins / vim-tmux-focus-events

Make terminal vim and tmux work better together.
MIT License
348 stars 23 forks source link

Issue with focus switching while autocomplete popup open #10

Closed achilleas-k closed 7 years ago

achilleas-k commented 8 years ago

When there's an autocomplete popup open and the focus is changed, the focus lost and gain commands are simply typed into the text. I guess this might be caused by the plugin failing to escape to normal mode to issue the commands and instead they get typed in insert mode.

Is there any way around this? I use automatic completion popups (SimpleAutoComplPop), so it's not rare that I will have an autocompletion list open and I will alt-tab out to check documentation.

wookayin commented 7 years ago

This bug is so annoying for me as well. If popup menu is open (pumvisible()), the action <C-O> from inoremap <silent> <F24> <C-O>:silent doautocmd FocusLost %<CR> is ignored.

So my workaround here is to use <C-\><C-O>

inoremap <silent> <F24> <C-\><C-O>:silent doautocmd FocusLost %<CR>
inoremap <silent> <F25> <C-\><C-O>:silent doautocmd FocusGained %<CR>

and it works well for me :)

bruno- commented 7 years ago

This is solved now that #12 is merged.