summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranakimluke <anakimluke@users.noreply.github.com>2020-08-28 03:16:56 -0300
committeranakimluke <anakimluke@users.noreply.github.com>2020-08-28 04:16:37 -0300
commit42f7938af9407541d4a7db9b8be92f4c416ab998 (patch)
tree21a2784c08a6cb11036a144cfa8486bdaad288cc
parentc7508a99f1e031207fbfede4242aa174a006eaa0 (diff)
Fixed FFF_MARK_FORMAT bug
Fixed default affixes not being suppressed when user provides custom settings. closes #157
-rwxr-xr-xfff12
1 files changed, 8 insertions, 4 deletions
diff --git a/fff b/fff
index 4e3a992..5e20f97 100755
--- a/fff
+++ b/fff
@@ -79,10 +79,14 @@ setup_options() {
}
# Format for marked files.
- [[ $FFF_MARK_FORMAT == *%f* ]] && {
+ # Use affixes provided by the user or use defaults, if necessary.
+ if [[ $FFF_MARK_FORMAT == *%f* ]]; then
mark_pre=${FFF_MARK_FORMAT/'%f'*}
mark_post=${FFF_MARK_FORMAT/*'%f'}
- }
+ else
+ mark_pre=" "
+ mark_post="*"
+ fi
# Find supported 'file' arguments.
file -I &>/dev/null || : "${file_flags:=biL}"
@@ -291,8 +295,8 @@ print_line() {
# If the list item is marked for operation.
[[ ${marked_files[$1]} == "${list[$1]:-null}" ]] && {
- format+=\\e[3${FFF_COL3:-1}m${mark_pre:= }
- suffix+=${mark_post:=*}
+ format+=\\e[3${FFF_COL3:-1}m${mark_pre}
+ suffix+=${mark_post}
}
# Escape the directory string.