After cd, clear status of hidden files toggle

Otherwise the value of "$hidden" is kept.
This means if you press '.' in a directory then cd to a new directory, you need to press '.' twice to view hidden files.
This commit is contained in:
Loomx 2020-10-11 15:52:43 +13:00 committed by GitHub
parent 8920178753
commit 6572ae7a44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

10
shfm
View File

@ -291,7 +291,7 @@ main() {
l?|C2|"$esc") # ARROW RIGHT
if [ -d "$cur" ] && cd -- "$cur" >/dev/null 2>&1; then
set -- *
y=1 y2=1 cur=$1 ltype=
y=1 y2=1 cur=$1 ltype= hidden=
redraw "$@"
elif [ -e "$cur" ]; then
@ -309,7 +309,7 @@ main() {
esac
set -- *
y=1 y2=1 cur=$1 hist=1
y=1 y2=1 cur=$1 hist=1 hidden=
redraw "$@"
;;
@ -350,7 +350,7 @@ main() {
cd -- "${ans:="$0"}" >/dev/null 2>&1|| continue
set -- *
y=1 y2=1 cur=$1
y=1 y2=1 cur=$1 hidden=
redraw "$@"
;;
@ -373,14 +373,14 @@ main() {
-?)
cd -- "$OLDPWD" >/dev/null 2>&1|| continue
set -- *
y=1 y2=1 cur=$1
y=1 y2=1 cur=$1 hidden=
redraw "$@"
;;
\~?)
cd || continue
set -- *
y=1 y2=1 cur=$1
y=1 y2=1 cur=$1 hidden=
redraw "$@"
;;