From d0508d06295adbaafdb929d9ed3bdae2774ae41b Mon Sep 17 00:00:00 2001 From: ful1e5 <24286590+ful1e5@users.noreply.github.com> Date: Thu, 14 Apr 2022 14:25:43 +0530 Subject: [PATCH] fix: use pcall to clear autocmd silently projekt0n/github-nvim-theme#178 ( @xiyaowong ) --- CHANGELOG.md | 1 + lua/onedark/autocmds.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43fd7a4..2f8b1fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lua/onedark/autocmds.lua b/lua/onedark/autocmds.lua index 8ae204e..a24335f 100644 --- a/lua/onedark/autocmds.lua +++ b/lua/onedark/autocmds.lua @@ -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 }) @@ -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, })