]> Sergey Matveev's repositories - nnn.git/commitdiff
Clear the selection for uniform behaviour
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 29 May 2021 10:36:42 +0000 (16:06 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 29 May 2021 10:36:42 +0000 (16:06 +0530)
plugins/fzcd

index 077456ab4c0117d1284d1cadba07284b4c8eaf26..ae3339246939a49f133750c069e0e499c801bb15 100755 (executable)
@@ -39,6 +39,11 @@ fi
 if [ -n "$1" ] && [ "$(file -b --mime-type "$1")" = 'text/plain' ] && [ -e "$(head -1 "$1")" ]; then
     LIST="$1"
 elif ! [ -s "$LIST" ]; then
+    # Clear selection
+    if [ -p "$NNN_PIPE" ]; then
+        printf "-" >"$NNN_PIPE"
+    fi
+
     sel=$(fzf)
     # Show only the file and parent dir
     # sel=$(fzf --delimiter / --with-nth=-2,-1 --tiebreak=begin --info=hidden)