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: ensure nil checks before Neovim API calls #257

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

argizuno
Copy link
Contributor

@argizuno argizuno commented Dec 9, 2024

fix an issue where closing a window occasionally triggers an error due to an invalid window reference:

Error detected while processing BufLeave Autocommands for "<buffer=2>":
Error executing lua callback: ...y/render-markdown.nvim/lua/render-markdown/core/util.lua:38: Invalid 'window': Expected Lua number
stack traceback:
        [C]: in function 'nvim_win_is_valid'
        ...y/render-markdown.nvim/lua/render-markdown/core/util.lua:38: in function 'valid'
        ...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:80: in function 'update'
        ...azy/render-markdown.nvim/lua/render-markdown/manager.lua:77: in function <...azy/render-markdown.nvim/lua/render-markdown/manager.lua:70>

@MeanderingProgrammer
Copy link
Owner

Thanks for the PR!

@MeanderingProgrammer MeanderingProgrammer merged commit bc8a681 into MeanderingProgrammer:main Dec 9, 2024
@MeanderingProgrammer
Copy link
Owner

I updated the logic to run the nil check prior to calling update: eb8fdac

Just so the type annotations are still meaningful, if the issue crops up again please LMK!

@argizuno
Copy link
Contributor Author

It seems to be working! Thank you, and keep up the great work!

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