shfm: fix glob issues with hidden files

Let's just allow '.' and '..' to appear in the list as
they are fully functional entries after all. Also removes
the need for a "no hidden files" message.
This commit is contained in:
Dylan Araps 2020-09-24 15:18:34 +03:00
parent b8efa71b97
commit 8920178753
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 4 additions and 5 deletions

9
shfm
View File

@ -136,9 +136,8 @@ list_print() {
end=$((bottom + 1))
mid=$((bottom / 4 < 5 ? 1 : bottom / 4))
[ -e "$1" ] || case $1$# in
'*1') set -- empty ;;
'.[!.]*1') set -- 'no hidden files'
case $# in
1) [ -e "$1" ] || set -- empty
esac
case $hist in
@ -331,8 +330,8 @@ main() {
.?)
case ${hidden:=1} in
1) hidden=0; set -- .[!.]* ;;
*) hidden=1; set -- * ;;
1) hidden=0; set -- .* ;;
0) hidden=1; set -- *
esac
y=1 y2=1 cur=$1