From 73f656547464b5f90d87ea69536440375924cd48 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Thu, 19 Mar 2026 22:03:22 +0100 Subject: [PATCH] treesitter: remove foldByDefault --- docs/manual/release-notes/rl-0.9.md | 4 ++++ modules/extra/deprecations.nix | 5 +++++ modules/plugins/treesitter/config.nix | 2 -- modules/plugins/treesitter/treesitter.nix | 1 - 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index 0bea2b95..e5b2652d 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -29,6 +29,10 @@ is unlikely to cause any noticeable change in behavior or breakage, it's mentioned just in case. +- `vim.treesitter.foldByDefault` is removed. Folding behavior should be + controlled via `vim.options.foldenable` directly instead. RIP + `vim.treesitter.foldByDefault` 2026-03-19 - 2026-03-19. + [Snoweuph](https://github.com/snoweuph) - "Correct `languages.go.treesitter` to contain all Go file types. diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index 76d258bd..1572f249 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -342,5 +342,10 @@ in { Incremental selection configuration has been removed from nvim-treesitter. '') ] + + # 2026-03-19 + [ + (mkRenamedOptionModule ["vim" "treesitter" "foldByDefault"] ["vim" "options" "foldenable"]) + ] ]; } diff --git a/modules/plugins/treesitter/config.nix b/modules/plugins/treesitter/config.nix index e1bbc3c4..1ca628b0 100644 --- a/modules/plugins/treesitter/config.nix +++ b/modules/plugins/treesitter/config.nix @@ -6,7 +6,6 @@ inherit (lib.modules) mkIf; inherit (lib.lists) optionals; inherit (lib.nvim.dag) entryAfter; - inherit (lib.trivial) boolToString; cfg = config.vim.treesitter; in { @@ -55,7 +54,6 @@ in { callback = function() vim.wo[0][0].foldmethod = "expr" vim.wo[0][0].foldexpr = "v:lua.vim.treesitter.foldexpr()" - vim.o.foldenable = ${boolToString cfg.foldByDefault} end, }) ''} diff --git a/modules/plugins/treesitter/treesitter.nix b/modules/plugins/treesitter/treesitter.nix index dd62e750..c2039a9f 100644 --- a/modules/plugins/treesitter/treesitter.nix +++ b/modules/plugins/treesitter/treesitter.nix @@ -10,7 +10,6 @@ in { enable = mkEnableOption "treesitter, also enabled automatically through language options"; fold = mkEnableOption "fold with treesitter"; - foldByDefault = mkEnableOption "folding by default when a file is opened"; autotagHtml = mkEnableOption "autoclose and rename html tag"; grammars = mkOption {