ZSH: make find file only give 1 result

This commit is contained in:
Jonathan Hodgson 2021-08-31 11:04:46 +01:00
parent fb3fb4365e
commit ad9a516eb8

View file

@ -164,7 +164,7 @@ find_current_file(){
return 0
fi
# Next try locate with an exact filename match
filepath="$(locate "*/$lastWord")"
filepath="$(locate "*/$lastWord" | sed -n 1p)"
if [ "$?" -eq 0 ]; then
tokens[-1]="$filepath"
LBUFFER="${tokens[@]}"