diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-28 07:18:43 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-05-28 07:18:43 +0000 |
commit | e24280f07a09b142cec6c35affbda616b270073a (patch) | |
tree | 838c2d531cbd21934216d31bc62675be0d06e8c3 /usr.bin/tmux/window-tree.c | |
parent | da4818b66eb44a1b7d0f1f5b2171d8e61b0d068d (diff) |
Change display-menu from taking a single string to a set of arguments,
which is much easier to work with. Based on a diff from Avi Halachmi.
Diffstat (limited to 'usr.bin/tmux/window-tree.c')
-rw-r--r-- | usr.bin/tmux/window-tree.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/usr.bin/tmux/window-tree.c b/usr.bin/tmux/window-tree.c index 4082a85d1cd..e4b52c7d423 100644 --- a/usr.bin/tmux/window-tree.c +++ b/usr.bin/tmux/window-tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-tree.c,v 1.38 2019/05/12 08:58:09 nicm Exp $ */ +/* $OpenBSD: window-tree.c,v 1.39 2019/05/28 07:18:42 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -53,18 +53,21 @@ static void window_tree_key(struct window_mode_entry *, "}" \ "}" -#define WINDOW_TREE_MENU \ - "Select,Enter,|" \ - "Expand,Right,|" \ - "|" \ - "Tag,t,|" \ - "Tag All,C-t,|" \ - "Tag None,T,|" \ - "|" \ - "Kill,x,|" \ - "Kill Tagged,X,|" \ - "|" \ - "Cancel,q," +static const struct menu_item window_tree_menu_items[] = { + { "Select", 'E', NULL }, + { "Expand", 'R', NULL }, + { "", KEYC_NONE, NULL }, + { "Tag", 't', NULL }, + { "Tag All", '\024', NULL }, + { "Tag None", 'T', NULL }, + { "", KEYC_NONE, NULL }, + { "Kill", 'x', NULL }, + { "Kill Tagged", 'X', NULL }, + { "", KEYC_NONE, NULL }, + { "Cancel", 'q', NULL }, + + { NULL, KEYC_NONE, NULL } +}; const struct window_mode window_tree_mode = { .name = "tree-mode", @@ -872,7 +875,7 @@ window_tree_init(struct window_mode_entry *wme, struct cmd_find_state *fs, data->data = mode_tree_start(wp, args, window_tree_build, window_tree_draw, window_tree_search, window_tree_menu, data, - WINDOW_TREE_MENU, window_tree_sort_list, + window_tree_menu_items, window_tree_sort_list, nitems(window_tree_sort_list), &s); mode_tree_zoom(data->data, args); |