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: crashes on lines with invalid syntax #399

Merged

Conversation

kwaszczuk
Copy link
Contributor

@kwaszczuk kwaszczuk commented Feb 17, 2024

Fixes #397

In #388 we have slightly refactored logic for acquiring langtree nodes for a line, and we did not recreate error handling logic existing previously. Thus, in case if the tree node for the given line cannot be found (e.g. due to the invalid syntax), the plugin crashes. Restoring the null handling seems to resolve the entire problem.

@kwaszczuk kwaszczuk marked this pull request as ready for review February 17, 2024 00:50
@lewis6991 lewis6991 merged commit 23b699a into nvim-treesitter:master Feb 17, 2024
2 checks passed
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.

context.lua:17: attempt to index local 'tree' (a nil value)
2 participants