Skip to content

Commit

Permalink
Apply initial filter before evaluating accept-single
Browse files Browse the repository at this point in the history
This lets us select fully non-interactive if we have a perfect match

Signed-off-by: Robert Günzler <r@gnzler.io>
  • Loading branch information
robertgzr authored and Cloudef committed Dec 16, 2022
1 parent 516a2ab commit 0a44fb6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,10 @@ menu_with_options(struct client *client)
enum bm_run_result
run_menu(const struct client *client, struct bm_menu *menu, void (*item_cb)(const struct client *client, struct bm_item *item))
{
bm_menu_set_highlighted_index(menu, client->selected);
bm_menu_grab_keyboard(menu, true);
bm_menu_set_filter(menu, client->initial_filter);

{
uint32_t total_item_count;
struct bm_item **items = bm_menu_get_items(menu, &total_item_count);
Expand All @@ -584,10 +588,6 @@ run_menu(const struct client *client, struct bm_menu *menu, void (*item_cb)(cons

}

bm_menu_set_highlighted_index(menu, client->selected);
bm_menu_grab_keyboard(menu, true);
bm_menu_set_filter(menu, client->initial_filter);

uint32_t unicode;
enum bm_key key = BM_KEY_NONE;
struct bm_pointer pointer;
Expand Down

0 comments on commit 0a44fb6

Please sign in to comment.