Skip to content

Commit a715ad7

Browse files
committed
chore(context): add augroup to autocmds
1 parent 39ee06f commit a715ad7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/opencode/context.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,10 @@ function M.setup()
497497
M.load()
498498
end)
499499

500+
local augroup = vim.api.nvim_create_augroup('OpenCodeContext', { clear = true })
500501
vim.api.nvim_create_autocmd('BufWritePost', {
501502
pattern = '*',
503+
group = augroup,
502504
callback = function(args)
503505
local buf = args.buf
504506
local curr_buf = state.current_code_buf or vim.api.nvim_get_current_buf()
@@ -510,6 +512,7 @@ function M.setup()
510512

511513
vim.api.nvim_create_autocmd('DiagnosticChanged', {
512514
pattern = '*',
515+
group = augroup,
513516
callback = function(args)
514517
local buf = args.buf
515518
local curr_buf = state.current_code_buf or vim.api.nvim_get_current_buf()

0 commit comments

Comments
 (0)