From b86db98f53c73afa7081cfa07103f21a724796ce Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Tue, 11 Jun 2024 16:51:52 +0100 Subject: [PATCH] plugins/dap-ui: normalize plugin defaults --- plugins/dap/dap-ui.nix | 93 +++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 43 deletions(-) diff --git a/plugins/dap/dap-ui.nix b/plugins/dap/dap-ui.nix index 6828b900..d37acbc0 100644 --- a/plugins/dap/dap-ui.nix +++ b/plugins/dap/dap-ui.nix @@ -15,9 +15,9 @@ let name: mapAttrs ( key: default: - helpers.defaultNullOpts.mkNullable (with types; either str (listOf str)) "${ - default - }" "Map `${key}` for ${name}" + helpers.defaultNullOpts.mkNullable ( + with types; either str (listOf str) + ) default "Map `${key}` for ${name}" ); elementOption = types.submodule { @@ -90,7 +90,10 @@ in types.submodule { options = mkKeymapOptions "element mapping overrides" { edit = "e"; - expand = ''["" "<2-LeftMouse>"]''; + expand = [ + "" + "<2-LeftMouse>" + ]; open = "o"; remove = "d"; repl = "r"; @@ -109,7 +112,12 @@ in border = helpers.defaultNullOpts.mkBorder "single" "dap-ui floating window" ""; mappings = helpers.mkNullOrOption (types.submodule { - options = mkKeymapOptions "dap-ui floating" { close = ''["" "q"]''; }; + options = mkKeymapOptions "dap-ui floating" { + close = [ + "" + "q" + ]; + }; }) "Keys to trigger actions in elements."; }; @@ -121,53 +129,52 @@ in expanded = helpers.defaultNullOpts.mkStr "" ""; }; - layouts = helpers.defaultNullOpts.mkNullable (types.listOf layoutOption) '' - ```nix - [ + layouts = helpers.defaultNullOpts.mkListOf layoutOption [ + { + elements = [ { - elements = [ - { - id = "scopes"; - size = 0.25; - } - { - id = "breakpoints"; - size = 0.25; - } - { - id = "stacks"; - size = 0.25; - } - { - id = "watches"; - size = 0.25; - } - ]; - position = "left"; - size = 40; + id = "scopes"; + size = 0.25; } { - elements = [ - { - id = "repl"; - size = 0.5; - } - { - id = "console"; - size = 0.5; - } - ]; - position = "bottom"; - size = 10; + id = "breakpoints"; + size = 0.25; + } + { + id = "stacks"; + size = 0.25; + } + { + id = "watches"; + size = 0.25; } ]; - ``` - '' "List of layouts for dap-ui."; + position = "left"; + size = 40; + } + { + elements = [ + { + id = "repl"; + size = 0.5; + } + { + id = "console"; + size = 0.5; + } + ]; + position = "bottom"; + size = 10; + } + ] "List of layouts for dap-ui."; mappings = helpers.mkNullOrOption (types.submodule { options = mkKeymapOptions "dap-ui" { edit = "e"; - expand = ''["" "<2-LeftMouse>"]''; + expand = [ + "" + "<2-LeftMouse>" + ]; open = "o"; remove = "d"; repl = "r";