From b2314312f2ee6893c83d0b5af74d949bc8530409 Mon Sep 17 00:00:00 2001 From: Mahmoud Ayman Date: Sat, 8 Mar 2025 20:37:10 +0200 Subject: [PATCH] zsh: correct syntax option to syntax-highlighting (#5792) The current syntax of highlighting style is outdated and not working as well. So this pr aims to update it so follow `zsh-syntax-highlight`` new syntax [example](https://github.com/zsh-users/zsh-syntax-highlighting/blob/e0165eaa730dd0fa321a6a6de74f092fe87630b0/highlighters/main/main-highlighter.zsh#L32). --- modules/programs/zsh.nix | 2 +- tests/modules/programs/zsh/syntax-highlighting.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 25adab2d2..e4399d2d7 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -738,7 +738,7 @@ in ZSH_HIGHLIGHT_HIGHLIGHTERS+=(${lib.concatStringsSep " " (map lib.escapeShellArg cfg.syntaxHighlighting.highlighters)}) ${lib.concatStringsSep "\n" ( lib.mapAttrsToList - (name: value: "ZSH_HIGHLIGHT_STYLES+=(${lib.escapeShellArg name} ${lib.escapeShellArg value})") + (name: value: "ZSH_HIGHLIGHT_STYLES[${lib.escapeShellArg name}]=${lib.escapeShellArg value}") cfg.syntaxHighlighting.styles )} ${lib.concatStringsSep "\n" ( diff --git a/tests/modules/programs/zsh/syntax-highlighting.nix b/tests/modules/programs/zsh/syntax-highlighting.nix index 27970a123..ed7626fcb 100644 --- a/tests/modules/programs/zsh/syntax-highlighting.nix +++ b/tests/modules/programs/zsh/syntax-highlighting.nix @@ -15,6 +15,6 @@ nmt.script = '' assertFileContains home-files/.zshrc "source ${pkgs.hello}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_HIGHLIGHTERS+=(brackets pattern cursor)" - assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_STYLES+=(comment 'fg=#6c6c6c')" + assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_STYLES[comment]='fg=#6c6c6c'" ''; }