From: Placido Fernandez <9625282+fdplacido@users.noreply.github.com> Date: Thu, 15 Oct 2020 17:36:36 +0000 (+0000) Subject: fix bookmarks plugin on empty output (#762) X-Git-Tag: v3.5~30 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d38bed58b26a23de86f47b4d63a6f30572a0bd38;p=nnn.git fix bookmarks plugin on empty output (#762) * fix bookmarks plugin on empty output * fix indentation * remove redundant new line --- diff --git a/plugins/bookmarks b/plugins/bookmarks index b25e8e5f..9bf491ee 100755 --- a/plugins/bookmarks +++ b/plugins/bookmarks @@ -44,7 +44,11 @@ get_links() { [ -d "$entry" ] || continue printf "%20s -> %s\n" "$(basename "$entry")" "$(readlink -f "$entry")" - done | fzf | awk 'END { print "'"$BOOKMARKS_DIR"'/"$1 }' + done | fzf | + awk 'END { + if (length($1) == 0) { print "'"$PWD"'" } + else { print "'"$BOOKMARKS_DIR"'/"$1 } + }' } # Choose symlink with fzf