revert centering feature for now

This commit is contained in:
Dylan Araps 2020-08-04 14:02:10 +03:00
parent 15789232c8
commit e5fd2c415e
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 5 additions and 14 deletions

19
shfm
View File

@ -50,11 +50,7 @@ hist_search() {
for file do
case ${PWD%%/}/$file in
"$old_pwd")
y=$j
y2=$((j > bottom ? bottom/2 : j))
cur=$file
;;
"$old_pwd") y=$j y2=$((j > bottom ? bottom : j)) cur=$file
esac
j=$((j + 1))
@ -68,16 +64,11 @@ list_print() {
end=$((bottom + 1))
case $hist in
1)
hist_search "$@"
shift "$((y >= bottom ? y - (bottom / 2) : 0))"
;;
*)
shift "$((y >= bottom ? y - bottom : 0))"
;;
1) hist_search "$@"
esac
shift "$((y - bottom > 0 ? y - bottom : 0))"
for file do
file_escape "$file"
@ -92,7 +83,7 @@ list_print() {
i=$((i + 1))
done
printf '\033[%sH' "$((y > bottom ? y2 : y))"
printf '\033[%sH' "$((y > bottom ? bottom : y))"
}
redraw() {