aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Placido Fernandez <9625282+fdplacido@users.noreply.github.com>2020-10-15 17:36:36 +0000
committerGravatar GitHub <noreply@github.com>2020-10-15 23:06:36 +0530
commitd38bed58b26a23de86f47b4d63a6f30572a0bd38 (patch)
treebe52db5733bdefd4d708a15b21e53888aaeaa7d3
parentdbf12ed031cb26394ca1c8a0b0dcf3ad1a2b523b (diff)
downloadnnn-d38bed58b26a23de86f47b4d63a6f30572a0bd38.tar.gz
fix bookmarks plugin on empty output (#762)
* fix bookmarks plugin on empty output * fix indentation * remove redundant new line
-rwxr-xr-xplugins/bookmarks6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/bookmarks b/plugins/bookmarks
index b25e8e5..9bf491e 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