style: align bash guard with shfmt

This commit is contained in:
Kaiiiiiiiii 2026-02-03 13:54:49 +08:00
parent 97f89e3ee3
commit 6b71292dd1
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ mod tests {
) {
let opts = Opts { cmd, hook, echo, resolve_symlinks };
let source = Bash(&opts).render().unwrap();
assert!(source.contains("[[ -n \"${__zoxide_result}\" ]] || return"));
assert!(source.contains("[[ -n ${__zoxide_result} ]] || return"));
}
#[apply(opts)]

View File

@ -179,7 +179,7 @@ if [[ ${BASH_VERSINFO[0]:-0} -eq 4 && ${BASH_VERSINFO[1]:-0} -ge 4 || ${BASH_VER
elif [[ -z ${COMP_WORDS[-1]} ]]; then
# shellcheck disable=SC2312
__zoxide_result="$(\command zoxide query --exclude "$(__zoxide_pwd)" --interactive -- "{{ "${COMP_WORDS[@]:1:${#COMP_WORDS[@]}-2}" }}")" || return
[[ -n "${__zoxide_result}" ]] || return
[[ -n ${__zoxide_result} ]] || return
# In case the terminal does not respond to \e[5n or another
# mechanism steals the response, it is still worth completing