3
0
Fork 0
forked from mirrors/nixpkgs

zsh-autosuggestions: Fix module for 0.5.0

The update for zsh-autosuggestions in #51752 broke the module.
This fix reflects the required changes.
This commit is contained in:
Tim Steinbach 2018-12-10 10:10:19 -05:00
parent ea22830eaf
commit 97ad321e42
No known key found for this signature in database
GPG key ID: 472BFCCA96BD0EDA

View file

@ -18,13 +18,13 @@ in
};
strategy = mkOption {
type = types.enum [ "default" "match_prev_cmd" ];
default = "default";
type = types.enum [ "history" "match_prev_cmd" ];
default = "history";
description = ''
Set ZSH_AUTOSUGGEST_STRATEGY to choose the strategy for generating suggestions.
There are currently two to choose from:
* default: Chooses the most recent match.
* history: Chooses the most recent match.
* match_prev_cmd: Chooses the most recent match whose preceding history item matches
the most recently executed command (more info). Note that this strategy won't work as
expected with ZSH options that don't preserve the history order such as
@ -51,7 +51,7 @@ in
source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="${cfg.highlightStyle}"
export ZSH_AUTOSUGGEST_STRATEGY="${cfg.strategy}"
export ZSH_AUTOSUGGEST_STRATEGY=("${cfg.strategy}")
${concatStringsSep "\n" (mapAttrsToList (key: value: ''export ${key}="${value}"'') cfg.extraConfig)}
'';