mirror of
https://github.com/jiriks74/presence.nvim
synced 2024-12-29 19:32:05 +01:00
9fd2a30127
* fix: rewrite for latest commit * fix: formatting * fix: use BufEnter instead of BufRead for more stable presence updates * fix: change vimscript variable from false to 0 Co-authored-by: Andrew Kwon <andrewshky@gmail.com> * fix: revert back to TextChanged rather than InsertEnter, refactor bits of the codebase * fix: formatting * fix: luacheck error and compare options to numeric values rather than booleans Co-authored-by: Andrew Kwon <andrewshky@gmail.com>
11 lines
468 B
VimL
11 lines
468 B
VimL
" Define autocommands to handle auto-update events
|
|
function presence#SetAutoCmds()
|
|
augroup presence_events
|
|
autocmd!
|
|
if exists("g:presence_auto_update") && g:presence_auto_update
|
|
autocmd BufEnter * lua package.loaded.presence:update()
|
|
autocmd TextChanged * lua package.loaded.presence:update(nil, true)
|
|
autocmd VimLeavePre * lua package.loaded.presence:unregister_self()
|
|
endif
|
|
augroup END
|
|
endfunction
|