diff --git a/autoload/tmux_focus_events.vim b/autoload/tmux_focus_events.vim index 9147b3a..3178fd0 100644 --- a/autoload/tmux_focus_events.vim +++ b/autoload/tmux_focus_events.vim @@ -32,7 +32,10 @@ function! tmux_focus_events#focus_gained() augroup focus_gained_checktime au! " perform checktime ASAP when outside cmd line - au * * call delayed_checktime() + "This is buggy: + "au * * call delayed_checktime() + "Replacement: + au CmdLineLeave * call delayed_checktime() augroup END else silent checktime diff --git a/plugin/tmux_focus_events.vim b/plugin/tmux_focus_events.vim index b6f3fdd..c66a16d 100644 --- a/plugin/tmux_focus_events.vim +++ b/plugin/tmux_focus_events.vim @@ -68,12 +68,15 @@ endfunction call restore_focus_events() -" When '&term' changes values for '', '', '&t_ti' and '&t_te' are -" reset. Below autocmd restores values for those options. -au TermChanged * call restore_focus_events() - -" restore vim 'autoread' functionality -au FocusGained * call tmux_focus_events#focus_gained() +augroup TMUXFOCUS + au! + " When '&term' changes values for '', '', '&t_ti' and '&t_te' are + " reset. Below autocmd restores values for those options. + au TermChanged * call restore_focus_events() + + " restore vim 'autoread' functionality + au FocusGained * call tmux_focus_events#focus_gained() +augroup end let &cpo = s:save_cpo unlet s:save_cpo