nvim-treesitter-context
nvim-treesitter-context copied to clipboard
feat: make max_lines accept percentage (of window height) or function
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_linesshould be aninteger, but I couldn't force that ( due to not havingmath.typein lua 5.1) so I just checked againstnumber. Is this a problem? - Related to type annotations. I don't know if it is because of my local lsp config, but the
max_linestype 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!