Skip to content

Commit

Permalink
nixos/fcitx5: handle multi-line string and escape in quickPhrase
Browse files Browse the repository at this point in the history
  • Loading branch information
linsui committed Dec 22, 2024
1 parent fedf16b commit 1fa8882
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nixos/modules/i18n/input-method/fcitx5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ in
i18n.inputMethod.fcitx5.addons =
lib.optionals (cfg.quickPhrase != { }) [
(pkgs.writeTextDir "share/fcitx5/data/QuickPhrase.mb" (
lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name} ${value}") cfg.quickPhrase)
lib.mapAttrsToList (
name: value: "${name} ${builtins.replaceStrings [ "\n" "\\" ] [ "\\n" "\\\\" ] value}"
) cfg.quickPhrase
))
]
++ lib.optionals (cfg.quickPhraseFiles != { }) [
Expand Down

0 comments on commit 1fa8882

Please sign in to comment.