From d12846211b3430c0c0ec73b4395f7df8a64ea668 Mon Sep 17 00:00:00 2001 From: TheColorman Date: Mon, 3 Mar 2025 21:12:58 +0100 Subject: [PATCH] session/nvim-session-manager: fix autoload_mode type Fixes `Error detected while processing VimEnter Autocommands for "*"` by using an enum type for "autoload_mode" instead of a string --- docs/release-notes/rl-0.8.md | 5 +++++ .../session/nvim-session-manager/nvim-session-manager.nix | 3 +++ 2 files changed, 8 insertions(+) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 6027736a..b16ed6b2 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -200,3 +200,8 @@ [alfarel](https://github.com/alfarelcynthesis): - Add missing `yazi.nvim` dependency (`snacks.nvim`). + +[TheColorman](https://github.com/TheColorman) + +- Fix plugin `setupOpts` for `neovim-session-manager` having an invalid value + for `autoload_mode`. diff --git a/modules/plugins/session/nvim-session-manager/nvim-session-manager.nix b/modules/plugins/session/nvim-session-manager/nvim-session-manager.nix index 05d0b01b..41cff8a4 100644 --- a/modules/plugins/session/nvim-session-manager/nvim-session-manager.nix +++ b/modules/plugins/session/nvim-session-manager/nvim-session-manager.nix @@ -1,5 +1,6 @@ {lib, ...}: let inherit (lib.types) nullOr str bool; + inherit (lib.generators) mkLuaInline; inherit (lib) mkEnableOption mkOption types mkRenamedOptionModule; in { imports = let @@ -68,6 +69,8 @@ in { autoload_mode = mkOption { type = types.enum ["Disabled" "CurrentDir" "LastSession"]; + # variable `sm` referenced from ./config.nix + apply = value: mkLuaInline "sm.AutoloadMode.${value}"; default = "LastSession"; description = "Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession"; };