From e8577baab2a407b7c56256025f48073d93e3e122 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 14 Mar 2021 12:19:40 +0530 Subject: [PATCH] Fix #876: fzcd - go to dir and select file --- plugins/fzcd | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/fzcd b/plugins/fzcd index b3f5efff..a590d966 100755 --- a/plugins/fzcd +++ b/plugins/fzcd @@ -14,11 +14,9 @@ else fi if [ -n "$sel" ]; then - if ! [ -d "$sel" ]; then - sel=$(dirname "$sel") - elif [ "$sel" = "." ]; then + if [ "$sel" = "." ] || (! [ -d "$sel" ] && ! [ -f "$sel" ]); then exit 0 - fi + fi # Check if selected path returned # by fzf command is absolute