Skip to content

Conversation

@daxisunder
Copy link
Contributor

@daxisunder daxisunder commented Oct 8, 2025

This prevents runtime errors when transient windows like CopilotChat are closed. The WinScrolled autocommand was attempting to access a buffer from a window that no longer exists, triggering nvim_win_get_buf with an invalid window ID. This adds a guard using nvim_win_is_valid(winid) to ensure the callback only runs on valid windows.

Fixes noisy errors during rapid window closures and improves compatibility with plugins that use temporary floating windows.

@shellRaining shellRaining merged commit 9371351 into shellRaining:main Oct 8, 2025
2 checks passed
@shellRaining
Copy link
Owner

thank you for your contribution~

@daxisunder daxisunder deleted the fix-invalid-winid branch October 8, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants