nvim-treesitter-context
nvim-treesitter-context copied to clipboard
fix: avoid propagating empty context_lines
Description
This PR fixes an issue where sometime the ctx_lines used to define the height were empty, triggering an error about invalid height:
lua/treesitter-context/render.lua:51: 'height' key must be a positive Integer
The fix is checking if the context_lines are not empty, if it is, the close method is called.
PR Checklist:
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] I have added or updated tests that comprehensively prove my change is effective or that my feature works
Hey @lewis6991 !
Any chance to make this problem fix in some way? It is pretty annoying on a daily basis ahah. I'm ready to make changes or update to this PR if needed !
I've done some changes recently is this still an issue? If so do you have a way to reproduce the problem?
@lewis6991 I'll update and let you know if I encounter the issue again, thanks !
I'll assume this isn't an issue any more. Let me know if it is.