mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-27 03:47:37 +00:00
treesitter: allow setting of treesitter max_lines to be string for percentage values
This commit is contained in:
parent
294a078ee7
commit
7229abc7f3
2 changed files with 7 additions and 3 deletions
|
|
@ -444,5 +444,7 @@ https://github.com/gorbit99/codewindow.nvim
|
||||||
- Add `vim.treesitter.indent.excludes` to exclude filetypes from the treesitter
|
- Add `vim.treesitter.indent.excludes` to exclude filetypes from the treesitter
|
||||||
indentation; e.g. useful for Haskell and PureScript, for which treesitter
|
indentation; e.g. useful for Haskell and PureScript, for which treesitter
|
||||||
indentation does not work good
|
indentation does not work good
|
||||||
|
- Allow `vim.treesitter.context.setupOpts.max_lines` to also be given as a
|
||||||
|
string in order to allow percentage values like `"20%"`
|
||||||
|
|
||||||
<!-- vim: set textwidth=80: -->
|
<!-- vim: set textwidth=80: -->
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
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.types) mkPluginSetupOption;
|
||||||
inherit (lib.nvim.config) batchRenameOptions;
|
inherit (lib.nvim.config) batchRenameOptions;
|
||||||
migrationTable = {
|
migrationTable = {
|
||||||
|
|
@ -26,12 +26,14 @@ in {
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "treesitter-context" {
|
setupOpts = mkPluginSetupOption "treesitter-context" {
|
||||||
max_lines = mkOption {
|
max_lines = mkOption {
|
||||||
type = int;
|
type = either int str;
|
||||||
default = 0;
|
default = 0;
|
||||||
description = ''
|
description = ''
|
||||||
How many lines the window should span.
|
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.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue