aboutsummaryrefslogtreecommitdiff
path: root/bb.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-06-10 20:37:34 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-06-10 20:37:34 -0700
commit5a5f9afa05a1f4dfdcd559c0f28691a65bfc6b46 (patch)
treef7c03498ce9fd6dd86ae3c9386349b1fbb73eebe /bb.c
parent86c8bed803356d6855e75bd364085f9cf8717b9e (diff)
Updated with some cleaner behavior for PICK and added SPIN. Also removed
command line flags in favor of manually using `tput rmcup`. Updated the documentation.
Diffstat (limited to 'bb.c')
-rw-r--r--bb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bb.c b/bb.c
index 991f7df..dedf90d 100644
--- a/bb.c
+++ b/bb.c
@@ -1042,9 +1042,12 @@ bb_result_t execute_cmd(bb_t *bb, const char *cmd)
if (!lastslash) return BB_INVALID;
*lastslash = '\0'; // Split in two
cd_to(bb, pbuf);
- if (e->index >= 0)
+ e = load_entry(bb, lastslash+1);
+ if (!e) return BB_INVALID;
+ if (IS_VIEWED(e)) {
set_cursor(bb, e->index);
- if (!IS_VIEWED(e) && !IS_SELECTED(e))
+ return BB_OK;
+ } else if (!IS_SELECTED(e))
remove_entry(e);
return BB_OK;
}
@@ -1320,8 +1323,6 @@ void bb_browse(bb_t *bb, const char *path)
goto redraw;
}
move_cursor(tty_out, 0, termheight-1);
- if (binding->flags & NORMAL_TERM)
- fputs(T_OFF(T_ALT_SCREEN), tty_out);
fputs(T_ON(T_SHOW_CURSOR), tty_out);
close_term();
run_cmd_on_selection(bb, binding->command);