diff --git a/fff b/fff index 2068870..13199b7 100755 --- a/fff +++ b/fff @@ -297,6 +297,7 @@ get_icon() { # Icon for files whose names have an extension [[ "$2" == *"."* ]] && { + # Special files case "$2" in 'cmakelists.txt' |\ 'Makefile.ac' |\ @@ -338,6 +339,7 @@ get_icon() { 'react.jsx' ) printf -- ''; return ;; esac + # extension case "$3" in '7z' | 'apk' |\ 'bz2' | 'cab' |\ @@ -626,7 +628,7 @@ print_line() { fi # If the list item is under the cursor. - (($1 == scroll)) && + (("$1" == scroll)) && format+="\\e[1;3${FFF_COL4:-6};7m" # If the list item is marked for operation. @@ -637,9 +639,9 @@ print_line() { # Escape the directory string. # Remove all non-printable characters. - file_name=${file_name//[^[:print:]]/^[} + file_name="${file_name//[^[:print:]]/^[}" - (( ${FFF_FILE_ICON:=0} == 1 )) && \ + (( "${FFF_FILE_ICON:=0}" == 1 )) && \ icon="$(get_icon "${list[$1]}" "$file_name" "$file_ext") " printf '\r%b%s\e[m\r' \ @@ -1451,10 +1453,10 @@ main() { ((BASH_VERSINFO[0] > 3)) && read_flags=(-t 0.05) - ((${FFF_LS_COLORS:=1} == 1)) && + (("${FFF_LS_COLORS:=1}" == 1)) && get_ls_colors - ((${FFF_HIDDEN:=0} == 1)) && + (("${FFF_HIDDEN:=0}"== 1)) && shopt -s dotglob # Create the trash and cache directory if they don't exist.