aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseylerius <emhs08@gmail.com>2020-07-27 03:54:11 -0500
committerRobert Helgesson <robert@rycee.net>2020-07-27 16:48:38 +0200
commit89adfc9f0168e4aff48157c9cc84913c852d6a48 (patch)
tree55f1c8c1def86d14bf1ea848942d155847270333
parent7b73f840712de88093f6c056e3c658e114ca0b3c (diff)
qutebrowser: unwrap list from keybinding removal
The option to remove the default keybindings by setting the `programs.qutebrowser.enableDefaultKeybindings` variable to `false` had a list wrapped around the `config.py` line. This would cause a type coercion error. PR #1410
-rw-r--r--modules/programs/qutebrowser.nix2
-rw-r--r--tests/modules/programs/qutebrowser/keybindings.nix3
2 files changed, 4 insertions, 1 deletions
diff --git a/modules/programs/qutebrowser.nix b/modules/programs/qutebrowser.nix
index 60e043fb8b1..798363fb187 100644
--- a/modules/programs/qutebrowser.nix
+++ b/modules/programs/qutebrowser.nix
@@ -261,7 +261,7 @@ in {
++ mapAttrsToList (formatDictLine "c.url.searchengines") cfg.searchEngines
++ mapAttrsToList (formatDictLine "c.bindings.key_mappings")
cfg.keyMappings
- ++ optional (!cfg.enableDefaultBindings) [ "c.bindings.default = {}" ]
+ ++ optional (!cfg.enableDefaultBindings) "c.bindings.default = {}"
++ mapAttrsToList formatKeyBindings cfg.keyBindings
++ optional (cfg.extraConfig != "") cfg.extraConfig);
};
diff --git a/tests/modules/programs/qutebrowser/keybindings.nix b/tests/modules/programs/qutebrowser/keybindings.nix
index dc5c4dc11a8..e89e44b46d9 100644
--- a/tests/modules/programs/qutebrowser/keybindings.nix
+++ b/tests/modules/programs/qutebrowser/keybindings.nix
@@ -7,6 +7,8 @@ with lib;
programs.qutebrowser = {
enable = true;
+ enableDefaultBindings = false;
+
keyBindings = {
normal = {
"<Ctrl-v>" = "spawn mpv {url}";
@@ -27,6 +29,7 @@ with lib;
home-files/.config/qutebrowser/config.py \
${
pkgs.writeText "qutebrowser-expected-config.py" ''
+ c.bindings.default = {}
config.bind(",l", "config-cycle spellcheck.languages [\"en-GB\"] [\"en-US\"]", mode="normal")
config.bind("<Ctrl-v>", "spawn mpv {url}", mode="normal")
config.bind("<Ctrl-y>", "prompt-yes", mode="prompt")''