Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #33 and adding augroup #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion autoload/tmux_focus_events.vim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ function! tmux_focus_events#focus_gained()
augroup focus_gained_checktime
au!
" perform checktime ASAP when outside cmd line
au * * call <SID>delayed_checktime()
"This is buggy:
"au * * call <SID>delayed_checktime()
"Replacement:
au CmdLineLeave * call <SID>delayed_checktime()
augroup END
else
silent checktime
Expand Down
15 changes: 9 additions & 6 deletions plugin/tmux_focus_events.vim
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ endfunction

call <SID>restore_focus_events()

" When '&term' changes values for '<F24>', '<F25>', '&t_ti' and '&t_te' are
" reset. Below autocmd restores values for those options.
au TermChanged * call <SID>restore_focus_events()

" restore vim 'autoread' functionality
au FocusGained * call tmux_focus_events#focus_gained()
augroup TMUXFOCUS
au!
" When '&term' changes values for '<F24>', '<F25>', '&t_ti' and '&t_te' are
" reset. Below autocmd restores values for those options.
au TermChanged * call <SID>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