diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-10-03 14:13:27 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-10-03 14:13:27 -0700 |
| commit | 97bae88a1ef368b962df5b1ee147094a0d47d43e (patch) | |
| tree | 2e8e23d028e8db6141123206f799b80c46320c50 /bb.c | |
| parent | 68a3bbf7e215f2aa605f1f2086162f9d7aefda4f (diff) | |
For +deselect, allow +deselect (no colon) to mean "deselect everything"
to make it a simple command instead of +deselect: "$@"
Diffstat (limited to 'bb.c')
| -rw-r--r-- | bb.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); |
