Skip to content

Commit

Permalink
Only add non-null selections
Browse files Browse the repository at this point in the history
  • Loading branch information
gpanders committed Mar 6, 2020
1 parent b7d0c09 commit 6744bb7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/tty_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ static void action_select(tty_interface_t *state) {
update_state(state);

const char *selection = choices_get(state->choices, state->choices->selection);
if (choices_selected(state->choices, selection)) {
choices_deselect(state->choices, selection);
} else {
choices_select(state->choices, selection);
if (selection) {
if (choices_selected(state->choices, selection)) {
choices_deselect(state->choices, selection);
} else {
choices_select(state->choices, selection);
}
}
}

Expand Down

0 comments on commit 6744bb7

Please sign in to comment.