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

feat: make max_lines accept percentage (of window height) or function

Open guilhas07 opened this issue 1 year ago • 0 comments

Closes https://github.com/nvim-treesitter/nvim-treesitter-context/issues/275

Add the possibility of providing a percentage string of max_lines e.g., "5%"; or a function that returns a number or a percentage string.

Notes:

  • Looking at the config fields I see that max_lines should be an integer, but I couldn't force that ( due to not having math.type in lua 5.1) so I just checked against number. Is this a problem?
  • Related to type annotations. I don't know if it is because of my local lsp config, but the max_lines type is not inferred correctly.
  • Some formatting changes were made. I assume it's because of the stylua local file and not my config, tell me if I should revert them.

If there is something that I need to change let me know!

guilhas07 avatar Feb 28 '24 18:02 guilhas07