mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -08:00
fix(tooltips): improve behaviour when using zsh-autosuggestions
This commit is contained in:
parent
794bd5ea09
commit
94fa70675a
|
@ -82,7 +82,21 @@ function _posh-tooltip() {
|
|||
zle .reset-prompt
|
||||
fi
|
||||
|
||||
# https://github.com/zsh-users/zsh-autosuggestions - clear suggestion to avoid keeping it after the newly inserted space
|
||||
if [[ -n "$(zle -lL autosuggest-clear)" ]]; then
|
||||
# only if suggestions not disabled (variable not set)
|
||||
if ! [[ -v _ZSH_AUTOSUGGEST_DISABLED ]]; then
|
||||
zle autosuggest-clear
|
||||
fi
|
||||
fi
|
||||
zle .self-insert
|
||||
# https://github.com/zsh-users/zsh-autosuggestions - fetch new suggestion after the space
|
||||
if [[ -n "$(zle -lL autosuggest-fetch)" ]]; then
|
||||
# only if suggestions not disabled (variable not set)
|
||||
if ! [[ -v _ZSH_AUTOSUGGEST_DISABLED ]]; then
|
||||
zle autosuggest-fetch
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function _posh-zle-line-init() {
|
||||
|
|
Loading…
Reference in a new issue