From 97bae88a1ef368b962df5b1ee147094a0d47d43e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 3 Oct 2019 14:13:27 -0700 Subject: For +deselect, allow +deselect (no colon) to mean "deselect everything" to make it a simple command instead of +deselect: "$@" --- bb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bb.c') diff --git a/bb.c b/bb.c index 5587960..2a5ee44 100644 --- a/bb.c +++ b/bb.c @@ -683,8 +683,11 @@ bb_result_t process_cmd(bb_t *bb, const char *cmd) case 'd': { // +deselect:, +dotfiles: switch (cmd[1]) { case 'e': { // +deselect: - if (!value && !bb->nfiles) return BB_INVALID; - if (!value) value = bb->files[bb->cursor]->fullname; + if (!value) { + while (bb->firstselected) + set_selected(bb, bb->firstselected, 0); + return BB_OK; + } char pbuf[PATH_MAX]; normalize_path(bb->path, value, pbuf, 1); entry_t *e = load_entry(bb, pbuf, 0); -- cgit v1.2.3