Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
fix: use pcall to clear autocmd silently projekt0n/github-nvim-theme#178
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Apr 14, 2022
1 parent db5b0f4 commit d0508d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- docs: fixed config's default value in README.md
- fixed projekt0n/github-nvim-theme#172
- fixed #106
- fix: use pcall to clear autocmd silently projekt0n/github-nvim-theme#178 ( @xiyaowong )

## [v0.0.4]- 21 Jan 2022

Expand Down
4 changes: 2 additions & 2 deletions lua/onedark/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ autocmds.viml_cmds = function(config)
vim.cmd('augroup end')
end

---@param config onedark.ConfigSchema
---@param config od.ConfigSchema
autocmds.native_cmds = function(config)
local group = vim.api.nvim_create_augroup('onedark', { clear = false })

Expand All @@ -37,7 +37,7 @@ autocmds.native_cmds = function(config)
group = group,
callback = function()
if vim.g.colors_name ~= 'onedark' then
vim.api.nvim_del_augroup_by_id(group)
pcall(vim.api.nvim_del_augroup_by_id(group))
end
end,
})
Expand Down

2 comments on commit d0508d0

@xiyaowong
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pcall(vim.api.nvim_del_augroup_by_id, group)

@ful1e5
Copy link
Owner Author

@ful1e5 ful1e5 commented on d0508d0 Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pcall(vim.api.nvim_del_augroup_by_id, group)

Thanks mate.
Fixed in 1f56c49

Please sign in to comment.