Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(events): clear augroup instead of deleting #100

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

scottmckendry
Copy link
Contributor

@scottmckendry scottmckendry commented Feb 2, 2025

fixes #99

Looks like this occurs when jumping from one ignored buffer to another (or if the event fires twice?).

The group is already deleted, so it attempts to delete it again, resulting in the error.

The fix is to check whether the group exists first with pcall before deleting.

We can use the nvim_clear_autocmds API in place of deleting to resolve this. Even if no autocmds are removed, no error will occur.

@scottmckendry scottmckendry marked this pull request as draft February 2, 2025 22:52
@scottmckendry scottmckendry changed the title fix(events): check if augroup exists before deleting fix(events): clear augroup instead of deleting Feb 2, 2025
@scottmckendry scottmckendry marked this pull request as ready for review February 2, 2025 22:59
@sphamba
Copy link
Owner

sphamba commented Feb 3, 2025

Thanks for the fix!

@sphamba sphamba added the bug Something isn't working label Feb 3, 2025
@sphamba sphamba merged commit 8555bae into sphamba:main Feb 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when entering a disabled filetype
2 participants