forked from andweeb/presence.nvim
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move autocmd to autoload and validate setup opts
- Loading branch information
Showing
3 changed files
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
" 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 BufRead * lua package.loaded.presence:update() | ||
endif | ||
augroup END | ||
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
" Define autocommands to handle auto-update events | ||
augroup presence_events | ||
autocmd! | ||
if g:presence_auto_update | ||
autocmd BufRead * lua package.loaded.presence:update() | ||
endif | ||
augroup END | ||
|
||
" Fallback to setting up the plugin automatically | ||
if !exists("g:presence_has_setup") | ||
lua << EOF | ||
local Presence = require("presence"):setup() | ||
Presence.log:debug("Custom setup not detected, plugin set up using defaults") | ||
Presence.log:debug("Custom setup not detected, using defaults") | ||
EOF | ||
endif |