Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Always act as file picker when instructed #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions fff
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,12 @@ open() {
redraw full

elif [[ -f $1 ]]; then
((file_picker == 1)) && {
printf '%s\n' "$1" > \
"${XDG_CACHE_HOME:=${HOME}/.cache}/fff/opened_file"
exit
}

# Figure out what kind of file we're working with.
get_mime_type "$1"

Expand All @@ -601,12 +607,6 @@ open() {
text/*|*x-empty*|*json*)
# If 'fff' was opened as a file picker, save the opened
# file in a file called 'opened_file'.
((file_picker == 1)) && {
printf '%s\n' "$1" > \
"${XDG_CACHE_HOME:=${HOME}/.cache}/fff/opened_file"
exit
}

clear_screen
reset_terminal
"${VISUAL:-${EDITOR:-vi}}" "$1"
Expand Down