summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordylan <dylan.araps@gmail.com>2021-06-11 08:17:18 +0000
committerGitHub <noreply@github.com>2021-06-11 08:17:18 +0000
commit5b90a8599cce3333672947438bb1718e1298e068 (patch)
tree40289d95edce4cce6882db2d9c5a02f61c7e25ca
parent70cd1edaf01b5c961b2b87887040ff573cfa754f (diff)
parent42f7938af9407541d4a7db9b8be92f4c416ab998 (diff)
Merge pull request #158 from anakimluke/mark-format-patch-1
Fixed FFF_MARK_FORMAT bug
-rwxr-xr-xfff12
1 files changed, 8 insertions, 4 deletions
diff --git a/fff b/fff
index 1978a82..16766e3 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.