mirror of
				https://github.com/zsh-users/zsh-autosuggestions.git
				synced 2025-10-30 15:26:29 +08:00 
			
		
		
		
	update predefined
This commit is contained in:
		
							parent
							
								
									420f370747
								
							
						
					
					
						commit
						616f7ba177
					
				@ -23,6 +23,11 @@ _zsh_autosuggest_predefined_generate() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	echo "autosuggestions is generating: $pname"
 | 
						echo "autosuggestions is generating: $pname"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# copy builtin predefine database
 | 
				
			||||||
 | 
						local txt="${_zsh_autosuggest_script_path}/predefined.txt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						[ -f "$txt" ] && cat "$txt" > "$pname"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# enumerate commands in $PATH and add them to ~/.zsh_autosuggest
 | 
						# enumerate commands in $PATH and add them to ~/.zsh_autosuggest
 | 
				
			||||||
    for p ("${(@s/:/)PATH}"); do
 | 
					    for p ("${(@s/:/)PATH}"); do
 | 
				
			||||||
        cd "$p"
 | 
					        cd "$p"
 | 
				
			||||||
@ -47,11 +52,7 @@ _zsh_autosuggest_predefined_generate() {
 | 
				
			|||||||
    done
 | 
					    done
 | 
				
			||||||
    cd "${pwd}"
 | 
					    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"
 | 
					# echo "sourced predefined"
 | 
				
			||||||
@ -61,7 +62,6 @@ _zsh_autosuggest_strategy_predefined() {
 | 
				
			|||||||
    setopt EXTENDED_GLOB
 | 
					    setopt EXTENDED_GLOB
 | 
				
			||||||
    local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}"
 | 
					    local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}"
 | 
				
			||||||
    local result="${history[(r)${prefix}*]}"
 | 
					    local result="${history[(r)${prefix}*]}"
 | 
				
			||||||
    result=""
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [[ $result == "" ]]; then
 | 
					    if [[ $result == "" ]]; then
 | 
				
			||||||
        if (( ! ${+_ZSH_AUTOSUGGEST_PREDEFINE} )); then
 | 
					        if (( ! ${+_ZSH_AUTOSUGGEST_PREDEFINE} )); then
 | 
				
			||||||
 | 
				
			|||||||
@ -589,6 +589,11 @@ _zsh_autosuggest_predefined_generate() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	echo "autosuggestions is generating: $pname"
 | 
						echo "autosuggestions is generating: $pname"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# copy builtin predefine database
 | 
				
			||||||
 | 
						local txt="${_zsh_autosuggest_script_path}/predefined.txt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						[ -f "$txt" ] && cat "$txt" > "$pname"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# enumerate commands in $PATH and add them to ~/.zsh_autosuggest
 | 
						# enumerate commands in $PATH and add them to ~/.zsh_autosuggest
 | 
				
			||||||
    for p ("${(@s/:/)PATH}"); do
 | 
					    for p ("${(@s/:/)PATH}"); do
 | 
				
			||||||
        cd "$p"
 | 
					        cd "$p"
 | 
				
			||||||
@ -613,11 +618,7 @@ _zsh_autosuggest_predefined_generate() {
 | 
				
			|||||||
    done
 | 
					    done
 | 
				
			||||||
    cd "${pwd}"
 | 
					    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"
 | 
					# echo "sourced predefined"
 | 
				
			||||||
@ -627,7 +628,6 @@ _zsh_autosuggest_strategy_predefined() {
 | 
				
			|||||||
    setopt EXTENDED_GLOB
 | 
					    setopt EXTENDED_GLOB
 | 
				
			||||||
    local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}"
 | 
					    local prefix="${1//(#m)[\\*?[\]<>()|^~#]/\\$MATCH}"
 | 
				
			||||||
    local result="${history[(r)${prefix}*]}"
 | 
					    local result="${history[(r)${prefix}*]}"
 | 
				
			||||||
    result=""
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [[ $result == "" ]]; then
 | 
					    if [[ $result == "" ]]; then
 | 
				
			||||||
        if (( ! ${+_ZSH_AUTOSUGGEST_PREDEFINE} )); then
 | 
					        if (( ! ${+_ZSH_AUTOSUGGEST_PREDEFINE} )); then
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user