treesitter: allow setting of treesitter max_lines to be string for percentage values

This commit is contained in:
Matthias Putz 2026-03-24 22:19:48 +01:00
commit 7229abc7f3
2 changed files with 7 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) int bool str nullOr enum;
inherit (lib.types) int bool str nullOr enum either;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.nvim.config) batchRenameOptions;
migrationTable = {
@ -26,12 +26,14 @@ in {
setupOpts = mkPluginSetupOption "treesitter-context" {
max_lines = mkOption {
type = int;
type = either int str;
default = 0;
description = ''
How many lines the window should span.
Values >= 0 mean there will be no limit.
Can be an absolute line number (given as int) or a percentage (given as string, e.g. "20%").
Values <= 0 mean there will be no limit.
'';
};