Skip to content

Commit

Permalink
[code](fff) Slight cleanup and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidd-Dino committed Sep 23, 2020
1 parent 265eb2e commit 12928b9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions fff
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ get_icon() {

# Icon for files whose names have an extension
[[ "$2" == *"."* ]] && {
# Special files
case "$2" in
'cmakelists.txt' |\
'Makefile.ac' |\
Expand Down Expand Up @@ -338,6 +339,7 @@ get_icon() {
'react.jsx' ) printf -- ''; return ;;
esac

# extension
case "$3" in
'7z' | 'apk' |\
'bz2' | 'cab' |\
Expand Down Expand Up @@ -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.
Expand All @@ -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' \
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 12928b9

Please sign in to comment.