From 420f37074793dd9d984d996f394247c72e824bca Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Sat, 3 Feb 2018 14:35:27 +0800 Subject: [PATCH] update predefined --- src/strategies/predefined.zsh | 11 +++++------ zsh-autosuggestions.zsh | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/strategies/predefined.zsh b/src/strategies/predefined.zsh index 94506bd..fc51bdf 100644 --- a/src/strategies/predefined.zsh +++ b/src/strategies/predefined.zsh @@ -23,11 +23,6 @@ _zsh_autosuggest_predefined_generate() { echo "autosuggestions is generating: $pname" - # copy builtin predefine database - local txt="${_zsh_autosuggest_script_path}/predefined.txt" - - [ -f "$txt" ] && cat "$txt" > "$pname" || touch "$pname" - # enumerate commands in $PATH and add them to ~/.zsh_autosuggest for p ("${(@s/:/)PATH}"); do cd "$p" @@ -52,7 +47,11 @@ _zsh_autosuggest_predefined_generate() { done cd "${pwd}" - print -l $suggests >> "$pname" + print -l $suggests > "$pname" + + # copy builtin predefine database + local txt="${_zsh_autosuggest_script_path}/predefined.txt" + cat "$txt" >> "$pname" } # echo "sourced predefined" diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 764117b..f5cf8e7 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -589,11 +589,6 @@ _zsh_autosuggest_predefined_generate() { echo "autosuggestions is generating: $pname" - # copy builtin predefine database - local txt="${_zsh_autosuggest_script_path}/predefined.txt" - - [ -f "$txt" ] && cat "$txt" > "$pname" || touch "$pname" - # enumerate commands in $PATH and add them to ~/.zsh_autosuggest for p ("${(@s/:/)PATH}"); do cd "$p" @@ -618,7 +613,11 @@ _zsh_autosuggest_predefined_generate() { done cd "${pwd}" - print -l $suggests >> "$pname" + print -l $suggests > "$pname" + + # copy builtin predefine database + local txt="${_zsh_autosuggest_script_path}/predefined.txt" + cat "$txt" >> "$pname" } # echo "sourced predefined"