Merge branch 'ohmyzsh:master' into omz-subexecutor

This commit is contained in:
Pandu E POLUAN 2024-04-23 14:37:01 +07:00 committed by GitHub
commit 4c7cbfeebc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 19 additions and 13 deletions

View file

@ -124,7 +124,7 @@ function _omz_async_callback() {
# Repaint prompt if output has changed
if [[ "$old_output" != "${_OMZ_ASYNC_OUTPUT[$handler]}" ]]; then
zle reset-prompt
zle .reset-prompt
zle -R
fi

View file

@ -39,21 +39,17 @@ function _omz_git_prompt_info() {
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}"
}
# Use async version if setting is enabled, or undefined but zsh version is at least 5.0.6
# https://github.com/ohmyzsh/ohmyzsh/issues/12331#issuecomment-2059460268
if zstyle -t ':omz:alpha:lib:git' async-prompt \
|| { is-at-least 5.0.6 && zstyle -T ':omz:alpha:lib:git' async-prompt }; then
# Use async version if setting is enabled or undefined
if zstyle -T ':omz:alpha:lib:git' async-prompt; then
function git_prompt_info() {
setopt localoptions noksharrays
if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]" ]]; then
echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]"
if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]}" ]]; then
echo -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_info]}"
fi
}
function git_prompt_status() {
setopt localoptions noksharrays
if [[ -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]" ]]; then
echo -n "$_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]"
if [[ -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]}" ]]; then
echo -n "${_OMZ_ASYNC_OUTPUT[_omz_git_prompt_status]}"
fi
}

View file

@ -1,3 +1,12 @@
function fzf_setup_using_fzf() {
(( ${+commands[fzf]} )) || return 1
local fzf_ver=${$(fzf --version)[1]}
is-at-least 0.48.0 $fzf_ver || return 1
eval "$(fzf --zsh)"
}
function fzf_setup_using_base_dir() {
local fzf_base fzf_shell fzfdirs dir
@ -217,7 +226,8 @@ Please add `export FZF_BASE=/path/to/fzf/install/dir` to your .zshrc
EOF
}
fzf_setup_using_openbsd \
fzf_setup_using_fzf \
|| fzf_setup_using_openbsd \
|| fzf_setup_using_debian \
|| fzf_setup_using_opensuse \
|| fzf_setup_using_cygwin \

View file

@ -62,7 +62,7 @@ function _add_identities() {
# if id is an absolute path, make file equal to id
[[ "$id" = /* ]] && file="$id" || file="$HOME/.ssh/$id"
# check for filename match, otherwise try for signature match
if [[ ${loaded_ids[(I)$file]} -le 0 ]]; then
if [[ -f $file && ${loaded_ids[(I)$file]} -le 0 ]]; then
sig="$(ssh-keygen -lf "$file" | awk '{print $2}')"
[[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+=("$file")
fi