2021-01-03 11:29:19 -08:00
|
|
|
" Define autocommands to handle auto-update events
|
|
|
|
function presence#SetAutoCmds()
|
|
|
|
augroup presence_events
|
|
|
|
autocmd!
|
|
|
|
if exists("g:presence_auto_update") && g:presence_auto_update
|
2021-05-31 17:44:31 -07:00
|
|
|
autocmd FocusGained * lua package.loaded.presence:handle_focus_gained()
|
|
|
|
autocmd TextChanged * lua package.loaded.presence:handle_text_changed()
|
|
|
|
autocmd VimLeavePre * lua package.loaded.presence:handle_vim_leave_pre()
|
|
|
|
autocmd WinEnter * lua package.loaded.presence:handle_win_enter()
|
|
|
|
autocmd WinLeave * lua package.loaded.presence:handle_win_leave()
|
2021-06-07 20:03:19 -07:00
|
|
|
autocmd BufEnter * lua package.loaded.presence:handle_buf_enter()
|
2021-05-31 17:44:31 -07:00
|
|
|
autocmd BufAdd * lua package.loaded.presence:handle_buf_add()
|
2021-01-03 11:29:19 -08:00
|
|
|
endif
|
|
|
|
augroup END
|
|
|
|
endfunction
|