Skip to content

Commit

Permalink
add extra unload autocmd
Browse files Browse the repository at this point in the history
  • Loading branch information
pynappo committed Aug 2, 2024
1 parent 7ffd994 commit 5c576ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugin/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ if vim.fn.has('nvim-0.9') then
vim.b[details.buf].cmp_buf_has_treesitter = true
end
end)
autocmd.subscribe({ 'BufUnload' }, function(details)
if vim.treesitter.language.get_lang(details.match) then
vim.b[details.buf].cmp_buf_has_treesitter = false
end
end)
end

vim.api.nvim_create_user_command('CmpStatus', function()
Expand Down

0 comments on commit 5c576ba

Please sign in to comment.