Skip to content

Commit 44bdbdf

Browse files
committed
fix(shortcuts): only escape commas in non-service shortcuts
1 parent 0bda28b commit 44bdbdf

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

modules/shortcuts.nix

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,22 @@ let
88
shortcutToConfigValue =
99
group: _action: skey:
1010
let
11-
# Keys are expected to be a list:
1211
keys =
1312
if !builtins.isList skey then
1413
[ skey ]
1514
else if builtins.length skey == 0 then
1615
[ "none" ]
1716
else
1817
skey;
19-
20-
# Don't allow un-escaped commas:
21-
escape = lib.escape [ "," ];
22-
keysStr = builtins.concatStringsSep "\t" (map escape keys);
18+
mkKeysString = lib.concatStringsSep "\t";
2319
in
2420

2521
# If the shortcut is not in the "services" group, we have to sanitize it.
2622
if lib.hasPrefix "services/" group then
27-
keysStr
23+
mkKeysString keys
2824
else
2925
lib.concatStringsSep "," [
30-
keysStr
26+
(mkKeysString (map (lib.escape [ "," ]) keys))
3127
"" # List of default keys, not needed.
3228
"" # Display string, not needed.
3329
];

0 commit comments

Comments
 (0)