fix(zsh): Only trigger up-arrow on first line (#1359)

* fix(zsh): Only trigger up-arrow on first line

* fix(zsh): only trigger up-key if the buffer is 1 line
This commit is contained in:
Patrick Jackson 2023-10-31 01:50:11 -06:00 committed by GitHub
parent a1799af567
commit e83bc6d632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,12 @@ _atuin_search() {
}
_atuin_up_search() {
_atuin_search --shell-up-key-binding
# Only trigger if the buffer is a single line
if [[ ! $BUFFER == *$'\n'* ]]; then
_atuin_search --shell-up-key-binding
else
zle up-line
fi
}
add-zsh-hook preexec _atuin_preexec