From 05e37166fce89a95561de1f5a95e52dd6e284333 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 2 Oct 2019 13:29:25 -0700 Subject: [PATCH] Fixed 'Enter' key behavior (should work properly for mac again now) --- bindings.bb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bindings.bb b/bindings.bb index 259b8d4..8551056 100644 --- a/bindings.bb +++ b/bindings.bb @@ -78,9 +78,15 @@ Ctrl-a: # Select all files here Section: File Actions Enter: # Open file/directory - if [ -d "$BBCURSOR" ]; then bb +cd:"$BBCURSOR"; - elif file -bi "$BBCURSOR" | grep -q '^\(text/\|inode/empty\)'; then $EDITOR "$BBCURSOR"; - else open "$BBCURSOR"; fi + if [ "$(uname)" = "Darwin" ]; then + if [ -d "$BBCURSOR" ]; then bb +cd:"$BBCURSOR"; + elif file -bI "$BBCURSOR" | grep -q '^\(text/\|inode/empty\)'; then $EDITOR "$BBCURSOR"; + else open "$BBCURSOR"; fi + else + if [ -d "$BBCURSOR" ]; then bb +cd:"$BBCURSOR"; + elif file -bi "$BBCURSOR" | grep -q '^\(text/\|inode/empty\)'; then $EDITOR "$BBCURSOR"; + else xdg-open "$BBCURSOR"; fi + fi e: # Edit file in $EDITOR $EDITOR "$BBCURSOR" || pause d: # Delete a file