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:
parent
35536fc6d6
commit
096d9c04b3
|
@ -9,7 +9,7 @@ let
|
||||||
formatLine = o: n: v:
|
formatLine = o: n: v:
|
||||||
let
|
let
|
||||||
formatValue = v:
|
formatValue = v:
|
||||||
if builtins.isNull v then
|
if v == null then
|
||||||
"None"
|
"None"
|
||||||
else if builtins.isBool v then
|
else if builtins.isBool v then
|
||||||
(if v then "True" else "False")
|
(if v then "True" else "False")
|
||||||
|
@ -29,7 +29,10 @@ let
|
||||||
formatKeyBindings = m: b:
|
formatKeyBindings = m: b:
|
||||||
let
|
let
|
||||||
formatKeyBinding = m: k: c:
|
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);
|
in concatStringsSep "\n" (mapAttrsToList (formatKeyBinding m) b);
|
||||||
|
|
||||||
formatQuickmarks = n: s: "${n} ${s}";
|
formatQuickmarks = n: s: "${n} ${s}";
|
||||||
|
@ -131,7 +134,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
keyBindings = mkOption {
|
keyBindings = mkOption {
|
||||||
type = with types; attrsOf (attrsOf (separatedString " ;; "));
|
type = with types; attrsOf (attrsOf (nullOr (separatedString " ;; ")));
|
||||||
default = { };
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Key bindings mapping keys to commands in different modes. This setting
|
Key bindings mapping keys to commands in different modes. This setting
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
keyBindings = {
|
keyBindings = {
|
||||||
normal = {
|
normal = {
|
||||||
|
":" = null;
|
||||||
"<Ctrl-v>" = "spawn mpv {url}";
|
"<Ctrl-v>" = "spawn mpv {url}";
|
||||||
",l" = ''config-cycle spellcheck.languages ["en-GB"] ["en-US"]'';
|
",l" = ''config-cycle spellcheck.languages ["en-GB"] ["en-US"]'';
|
||||||
"<F1>" = lib.mkMerge [
|
"<F1>" = lib.mkMerge [
|
||||||
|
@ -35,6 +36,7 @@
|
||||||
config.load_autoconfig(False)
|
config.load_autoconfig(False)
|
||||||
c.bindings.default = {}
|
c.bindings.default = {}
|
||||||
config.bind(",l", "config-cycle spellcheck.languages [\"en-GB\"] [\"en-US\"]", mode="normal")
|
config.bind(",l", "config-cycle spellcheck.languages [\"en-GB\"] [\"en-US\"]", mode="normal")
|
||||||
|
config.unbind(":", mode="normal")
|
||||||
config.bind("<Ctrl-v>", "spawn mpv {url}", mode="normal")
|
config.bind("<Ctrl-v>", "spawn mpv {url}", mode="normal")
|
||||||
config.bind("<F1>", "config-cycle tabs.show never always ;; config-cycle statusbar.show in-mode always ;; config-cycle scrolling.bar never always", mode="normal")
|
config.bind("<F1>", "config-cycle tabs.show never always ;; config-cycle statusbar.show in-mode always ;; config-cycle scrolling.bar never always", mode="normal")
|
||||||
config.bind("<Ctrl-y>", "prompt-yes", mode="prompt")''
|
config.bind("<Ctrl-y>", "prompt-yes", mode="prompt")''
|
||||||
|
|
Loading…
Reference in a new issue