nvim-treesitter-context icon indicating copy to clipboard operation
nvim-treesitter-context copied to clipboard

fix: avoid propagating empty context_lines

Open Freyskeyd opened this issue 1 year ago • 1 comments
trafficstars

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

Freyskeyd avatar Apr 19 '24 08:04 Freyskeyd

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 !

Freyskeyd avatar May 24 '24 15:05 Freyskeyd

I've done some changes recently is this still an issue? If so do you have a way to reproduce the problem?

lewis6991 avatar Jul 05 '24 13:07 lewis6991

@lewis6991 I'll update and let you know if I encounter the issue again, thanks !

Freyskeyd avatar Jul 09 '24 08:07 Freyskeyd

I'll assume this isn't an issue any more. Let me know if it is.

lewis6991 avatar Sep 03 '24 08:09 lewis6991