1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

qutebrowser: actually implement unbinding

The documentation for the option says...

> If you want a default binding to be passed through to the website,
> bind it to null.

but if you actually try to set a key to `null`, it causes an error.

> A definition for option
> `programs.qutebrowser.keyBindings."<Ctrl+Shift+Tab>".normal' is not
> of type `strings concatenated with " ;; "'.

So this commit implements unbinding as it is documented.
This commit is contained in:
Kylie McClain 2024-01-18 12:13:01 -05:00 committed by Robert Helgesson
parent 35536fc6d6
commit 096d9c04b3
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
2 changed files with 8 additions and 3 deletions

View file

@ -9,7 +9,7 @@ let
formatLine = o: n: v:
let
formatValue = v:
if builtins.isNull v then
if v == null then
"None"
else if builtins.isBool v then
(if v then "True" else "False")
@ -29,7 +29,10 @@ let
formatKeyBindings = m: b:
let
formatKeyBinding = m: k: c:
''config.bind("${k}", "${escape [ ''"'' ] c}", mode="${m}")'';
if c == null then
''config.unbind("${k}", mode="${m}")''
else
''config.bind("${k}", "${escape [ ''"'' ] c}", mode="${m}")'';
in concatStringsSep "\n" (mapAttrsToList (formatKeyBinding m) b);
formatQuickmarks = n: s: "${n} ${s}";
@ -131,7 +134,7 @@ in {
};
keyBindings = mkOption {
type = with types; attrsOf (attrsOf (separatedString " ;; "));
type = with types; attrsOf (attrsOf (nullOr (separatedString " ;; ")));
default = { };
description = ''
Key bindings mapping keys to commands in different modes. This setting