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
This commit is contained in:
TheColorman 2025-03-03 21:12:58 +01:00 committed by raf
parent f24189f1d2
commit d12846211b
2 changed files with 8 additions and 0 deletions
docs/release-notes
modules/plugins/session/nvim-session-manager

View file

@ -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`.

View file

@ -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";
};