nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 66f636de13c33dcb037f90c83b8a823b49b4c29e
parent 186f9d01ea5696fbe2fb45e710c49e2ec94056a6
Author: Arun <engineerarun@gmail.com>
Date:   Thu, 17 Aug 2023 05:09:19 +0530

Merge pull request #1712 from Rahlir/plugin-fzopen-fix

Fix bug in fzopen when selection is canceled
Diffstat:
Mplugins/fzopen | 42++++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/plugins/fzopen b/plugins/fzopen @@ -59,25 +59,27 @@ if [ "$3" ]; then exit 0 fi -if [ "$USE_NUKE" -ne 0 ]; then - "$NUKE" "$entry" - exit 0 -fi +if [ "$entry" ]; then + if [ "$USE_NUKE" -ne 0 ]; then + "$NUKE" "$entry" + exit 0 + fi -# Open the file (works for a single file only) -cmd_file="" -cmd_open="" -if uname | grep -q "Darwin"; then - cmd_file="file -bIL" - cmd_open="open" -else - cmd_file="file -biL" - cmd_open="xdg-open" -fi + # Open the file (works for a single file only) + cmd_file="" + cmd_open="" + if uname | grep -q "Darwin"; then + cmd_file="file -bIL" + cmd_open="open" + else + cmd_file="file -biL" + cmd_open="xdg-open" + fi -case "$($cmd_file "$entry")" in - *text*) - "${VISUAL:-$EDITOR}" "$entry" ;; - *) - $cmd_open "$entry" >/dev/null 2>&1 ;; -esac + case "$($cmd_file "$entry")" in + *text*) + "${VISUAL:-$EDITOR}" "$entry" ;; + *) + $cmd_open "$entry" >/dev/null 2>&1 ;; + esac +fi