From ec687c5adefed06a70c91c002fcbcbcd2cb40005 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 1 Mar 2024 14:10:59 +0100 Subject: [PATCH] plugins/goyo: switch to settings option --- plugins/utils/goyo.nix | 35 ++++++++++--------- .../example-configurations/issues.nix | 2 +- tests/test-sources/plugins/utils/goyo.nix | 8 +++-- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/plugins/utils/goyo.nix b/plugins/utils/goyo.nix index 3b9745ad..7a3d0f11 100644 --- a/plugins/utils/goyo.nix +++ b/plugins/utils/goyo.nix @@ -12,25 +12,28 @@ with lib; originalName = "goyo.vim"; defaultPackage = pkgs.vimPlugins.goyo-vim; globalPrefix = "goyo_"; + + # TODO introduced 2024-03-01: remove 2024-05-01 deprecateExtraConfig = true; + optionsRenamedToSettings = [ + "width" + "height" + ]; + imports = [ + ( + mkRenamedOptionModule + ["plugins" "goyo" "showLineNumbers"] + ["plugins" "goyo" "settings" "linenr"] + ) + ]; - options = { - width = mkDefaultOpt { - description = "Width"; - global = "width"; - type = types.int; - }; + settingsOptions = { + width = helpers.mkNullOrOption types.ints.unsigned "width"; - height = mkDefaultOpt { - description = "Height"; - global = "height"; - type = types.int; - }; + height = helpers.mkNullOrOption types.ints.unsigned "height"; - showLineNumbers = mkDefaultOpt { - description = "Show line numbers when in Goyo mode"; - global = "linenr"; - type = types.bool; - }; + linenr = helpers.defaultNullOpts.mkBool false '' + Show line numbers when in Goyo mode. + ''; }; } diff --git a/tests/test-sources/example-configurations/issues.nix b/tests/test-sources/example-configurations/issues.nix index ad1a7d74..6d70f40c 100644 --- a/tests/test-sources/example-configurations/issues.nix +++ b/tests/test-sources/example-configurations/issues.nix @@ -22,7 +22,7 @@ goyo = { enable = true; - showLineNumbers = false; + settings.linenr = false; }; lsp = { diff --git a/tests/test-sources/plugins/utils/goyo.nix b/tests/test-sources/plugins/utils/goyo.nix index 11d4eab4..18bc9c8a 100644 --- a/tests/test-sources/plugins/utils/goyo.nix +++ b/tests/test-sources/plugins/utils/goyo.nix @@ -7,9 +7,11 @@ plugins.goyo = { enable = true; - width = 80; - height = 85; - showLineNumbers = false; + settings = { + width = 80; + height = 85; + linenr = false; + }; }; }; }